0

我在我的根网络文件夹 public_html/ 中使用重写规则(seo)安装了我的信息网页。在子文件夹 public_html/shop/ 我已经安装了 Opencart 所以对购物车的访问是http://www.mydomain.com/shop/。每个文件夹 public_html、public_html_shop/ 都有自己的 .htaccess 文件。

我想将 OC1551 用作重定向到此文件夹的多个域上的多存储,但也用作 www.mydomaincom/shop/ - 未重定向:www.mydomain1.com、www.mydomain2.com 以及 www.mydomain.com/shop /

*public_html/shop/.htaccess* 文件需要将 rewritebase 设置为 /shop/ 才能正常使用 info 网页,因为 www.mydomain.com/ 使用重写规则,但 www.mydoaminX.com 需要设置为 rewritebase / . 你能请有人帮我在这些文件夹中设置 rewritebase 以使其正常工作吗?像动态更改 public_html/shop/.htaccess 文件中的重写库之类的东西。

谢谢

文件 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/shop/.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]
4

1 回答 1

0

实际上,我在大多数服务器上发现,您可以完全删除 RewriteBase,它足够聪明,可以弄清楚它是什么。我建议尝试一下,看看它是否有效

于 2013-02-11T16:18:53.367 回答