将一个子目录重写为另一个子目录

时间:2013-06-10 14:01:13

标签: apache .htaccess rewrite

我很难将我的商店域重写到我的Magento子目录中。这就是我追求的目标:

  

http://mydomain.com/shop/ - >的/ var / WWW / magento的/

     

http://mydomain.com/shop/anyFile.php - > /var/www/magento/anyFile.php

这是我目前在/var/www/.htaccess文件中的无效规则:

RewriteCond %{REQUEST_URI} ^/shop                
RewriteRule (.*) /magento/$1                     [L]

我哪里错了?

1 个答案:

答案 0 :(得分:0)

固定!我用以下代码替换了两行:

RewriteRule ^shop$         magento/index.php     [L]
RewriteRule ^shop(.*)$     magento$1             [L]
相关问题