开发者

301 redirect and /index.php

开发者 https://www.devze.com 2023-03-14 10:59 出处:网络
i made a grave mistake with my site. i didn\'t check the difference between .www and non .www so the one that had the www in it was a little broken.

i made a grave mistake with my site. i didn't check the difference between .www and non .www so the one that had the www in it was a little broken.

well anyways i've plugged a 301 redirect in here, and for http://mysite.com it's fine as usual, but the http://www.mysite.com now adds on /index.php. that can't be the best for SEO, right? (the cms is Textpattern if that is relevant)

another problem this redirect code has is: http://www.mysite.com/blog will take you back to the homepage.

what do you think?

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [R=301,开发者_如何转开发L]


i seem to have found the problem. i think that 301 script has to be at the top of the .htaccess document or it will cause problems. such as the blog problem and the /index.php inconsistency.

0

精彩评论

暂无评论...
验证码 换一张
取 消