0

非WWWドメインからWWWドメインへの301リダイレクトを使用しています!正常に動作しますが、リンクは異なります。

例:

from - ggkj.com/posts/godzilla/43
to - www.ggkj.com/index.php?view=posts&author=godzilla&aid=43

私の.htaccess301リダイレクトコード:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule ^(.*) http://www.example\.com/$1 [L,R=301]

.htaccessコード: http: //pastebin.com/t3FA59uq

4

2 に答える 2

1

This is currently what i use on my website with success:

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} !^www.walterbax.ca [NC]
RewriteRule ^(.*)$ http://www.walterbax.ca/$1 [R=301,L]

EDIT: after looking into your question a little further I can tell you that your issue is improperly placed in the file. it must be hitting another rule that is rewriting it into URL variables.

I would start with a basic htaccess for the www. rule for testing and add to it from there.

于 2012-06-29T19:37:28.303 に答える
0

Try this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com$
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]
于 2012-06-29T10:43:18.700 に答える