wordpress - 主目录中的 Htaccess 与子目录冲突

标签 wordpress .htaccess seo opencart

我正在为一个客户使用两个不同的开源系统。 在主目录上,我安装了 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/

相关文章:

php - 在 WooCommerce 中保存订单后,保存自定义项目元数据

php - 如何从 WordPress 中最近创建的类别中获取帖子

php - 浏览器同步 - PHP 和 htaccess?

layout - 美化搜索引擎中的搜索结果

php - 保留文本区域的换行符

php - 如何从 WordPress 中的 URL 中删除自定义分类库

php - 为几个页面设置 SSL

.htaccess - 强制 https 时 SagePay 失败

c# - SEO - 为爬虫重定向 301 的正确方法

html - 网站标题和其他次要部分的标题使用哪个标签