2013-02-11 74 views
0

我有我的根web文件夹public_html /安装我的信息网页使用重写规则(SEO)。在子文件夹public_html/shop /中,我安装了Opencart,因此对购物车的访问是http://www.mydomain.com/shop/。每个文件夹public_html,public_html_shop /都有自己的.htaccess文件。opencart - multistore和rewritebase

我想使用OC1551作为多个域重定向到此文件夹,但也作为www.mydomaincom /店/ - 不重定向:www.mydomain1.com,www.mydomain2.com和也作为www.mydomain .com/shop/

* public_html/shop/.htaccess *文件需要将rewritebase设置为/ shop /以正确使用信息网页,因为使用www.mydomain.com/的重写规则,但对于www.mydoaminX .com需要设置为rewritebase /。 你可以请某人帮我在这些文件夹中设置rewritebase来正确工作吗?像在public_html/shop/.htaccess文件中动态改变rewritebase的东西。

感谢

文件的public_html /的.htaccess

RewriteEngine On 
    RewriteBase/
    RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC] 
    RewriteRule ^.*$ http://www.mydomain.sk/$0 [NC,L,R=301] 

    RewriteRule ^(.*)/(.*)-([1-9])/(.*)/$ /index.php?category=$1&page=$2&gallery_page=$3&photo=$4 [L,QSA] 
    RewriteRule ^(.*)/(.*)/(.*)/$ /index.php?category=$1&page=$2&photo=$3 [L,QSA] 
    RewriteRule ^(.*)/(.*)-([1-9])/$ /index.php?category=$1&page=$2&gallery_page=$3 [L,QSA] 
    RewriteRule ^(.*)/(.*)/$ /index.php?category=$1&page=$2 [L,QSA] 
    RewriteRule ^(.*)/$ /index.php?category=$1 [L,QSA] 
    Rewriterule ^subscribe.php(.*)$ /index.php?category=overenie&addr=$1 [L,QSA] 
    Rewriterule ^sitemap.xml$ /webmap.php?engine=google [L,QSA] 
    Rewriterule ^urllist.txt$ /webmap.php?engine=yahoo [L,QSA] 

文件的public_html /店/的.htaccess

RewriteEngine On 
RewriteBase /shop/ 
RewriteCond %{HTTP_HOST} ^maydomain1\.com$ [NC] 
RewriteRule ^.*$ http://www.mydomain1.com/$0 [NC,L,R=301] 
RewriteCond %{HTTP_HOST} ^mydomain2\.com$ [NC] 
RewriteRule ^.*$ http://www.mydomain2.com/$0 [NC,L,R=301] 

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] 
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) 
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] 

回答

0

其实我觉得对大多数的服务器,你可以只需彻底删除RewriteBase,并且足够聪明就可以确定它是什么。我会建议尝试一下,看看它是否有效