0

我有以下 htaccess 文件

redirect 301 /index.php/medical-services/botox.html http://www.mysite.ca/medical-services/toronto-botox.php
redirect 301 /index.php/about-us.html http://www.mysite.ca/about-us/
redirect 301 /index.php/contact-us.html http://www.mysite.ca/contact-us.php
redirect 301 /index.php/contact/name.html http://www.mysite.ca/contact-us.php
redirect 301 /index.php/blog/ http://www.mysite.ca/blog/
#lots of 301 redirects
redirect 301 /glisodin-skin-nutrients.php http://www.mysite.ca/

<IfModule mod_rewrite.c>
Options -Indexes
Options +FollowSymlinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.mysite\.ca$
RewriteRule (.*) http://www.mysite.ca/$1 [R=301,L]

RewriteRule ^mobile$ /newsite2/mobile/ [L]

RewriteRule    ^$    newsite2/    [L]
RewriteRule    (.*) newsite2/$1    [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !contests
RewriteCond %{REQUEST_FILENAME} !administrator
RewriteCond %{REQUEST_FILENAME} !shop
RewriteRule ^newsite2/(.*)$ ./newsite2/$1 [QSA,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !contests
RewriteCond %{REQUEST_FILENAME} !administrator
RewriteCond %{REQUEST_FILENAME} !shop
RewriteRule ^(.*)$ /newsite2/$1 [QSA,L]  
</IfModule>

但是当我尝试输入时,让我们说:

http://skinvitality.ca/freebotox/ 它重定向到 http://skinvitality.ca/newsite2/freebotox/

我已经尝试了一切,但没有任何效果。

任何帮助将不胜感激。

4

1 回答 1

0

这些行:

RewriteRule    (.*) newsite2/$1    [L]
RewriteRule ^(.*)$ /newsite2/$1 [QSA,L]  

重写

RewriteRule (.*) http://www.skinvitality.ca/$1 [R=301,L]
于 2013-01-28T15:40:20.227 回答