【问题标题】:Blog in magento subdirectory not working without index.php如果没有 index.php,magento 子目录中的博客将无法工作
【发布时间】:2014-07-11 01:35:00
【问题描述】:

我在nginx 上托管了magento。我已经在magento roor 目录中安装了wordpress。

我的博客网址如 www.mymagento.com/blog 和博客文章网址如 www.mymagento.com/blog/page/2/

博文网址页面运行良好。但是当我去www.mymagento.com/blog.

页面结构混乱。

如果我在 magento admin 中启用 Use Web Server Rewrites 为 no,一切正常。

这是 www.mymagento.com 的虚拟网址。

如何解决这个问题,请帮忙。

【问题讨论】:

    标签: wordpress magento nginx url-rewriting


    【解决方案1】:

    在 www.mymagento.com/blog 的 .htaccess 中添加以下代码,清除浏览器历史并重试:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /shop/index.php [L]
    </IfModule>
    

    希望对你有帮助!

    【讨论】:

    • .htaccess 仅适用于 Apache 服务器。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-14
    • 2013-03-03
    • 1970-01-01
    相关资源
    最近更新 更多