我正在为一个客户使用两个不同的开源系统。 在主目录上,我安装了 wordpress。 在子目录 (/shop) 中我安装了 OpenCart 1.5.5
我想在 OpenCart 中启用 SEO url,但是当我启用它时,我的 url 变成: www.example.com/shop/category 来自 wordpress 的主要 htaccess 然后检查它是否知道类别和 wordpress 中的帖子并返回 404。
如果有人为我找到了解决方案,我将非常高兴! 感谢您的努力!
来自 Wordpress 的 HTACCESS:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
来自 opencart 的 HTACCESS:
Options +FollowSymlinks
Options -Indexes
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [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]
最佳答案
将 OpenCart .htaccess
中的 RewriteBase
指令更改为
RewriteBase /shop/
关于wordpress - 主目录中的 Htaccess 与子目录冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17472363/