0
我被困在一个看似简单的问题。 我感动我的网站从根及其所有内容到子文件夹,如的.htaccess重定向后Magento站点移至子目录
www.example.com
要
www.example.com/shop
现在,我想重定向所有的旧网页,以新的URL。
我试了一下在根的.htaccess,但did'nt工作:
RewriteEngine On
RewriteRule ^(shop)($|/) - [L] // To prevent loops
RewriteRule ^(.*)$ http://www.example.com/shop$1 [R=301,L]
但现在,所有的旧网页重定向到example.com/shop
编辑:
很是感动之后,我不得不以下代码添加到子目录的htaccess的,使其工作:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /shop/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /shop/index.php [L]
</IfModule>
这重定向到www.example.com/shop/index.php –
任何错了,它既然是'/店/'? – anubhava
请参阅编辑文章 –