【问题标题】:.htaccess Settings (Rewrite URL Rule) working on Localhost, But Not on Live Site.htaccess 设置(重写 URL 规则)适用于 Localhost,但不适用于 Live Site
【发布时间】:2013-03-08 03:48:40
【问题描述】:

我的 .htaccess 重写规则如下:

RewriteCond %{REQUEST_URI} ^/eshop/$ 
RewriteRule ^(.*)$ %{REQUEST_URI}index.php/eshop-new-home/ [R,L]
RewriteCond %{REQUEST_URI} ^/eshop/index.php/$
RewriteRule ^(.*)$ %{REQUEST_URI}eshop-new-home/ [R,L]

这些设置在本地主机上正常工作,但在实时网站上不起作用。有什么解决办法吗?

【问题讨论】:

  • 你有 apache 或者它的 nginx 还是什么?
  • @Meabed 是的,我的服务器是基于 linux 的,实时运行的是 apache 服务器
  • 你是否在 apache 配置中将 AllowOverride 更改为 AllowOverride All?
  • @Meabed :我的网站托管在其他服务器上,因此我无法访问 apache 配置。你告诉我要改变什么?
  • 您是否联系过您的托管公司以了解是否启用了 mod_rewrite 并且 AllowOverride 设置为 All 以便您可以在您的网站中使用 .htaccess

标签: .htaccess magento url-rewriting magento-1.7


【解决方案1】:

启用模组重写

LoadModule rewrite_module modules/mod_rewrite.so

AllowOverride All 

在你的 apache 配置中

【讨论】:

    猜你喜欢
    • 2013-09-02
    • 2012-12-01
    • 2012-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-10
    • 1970-01-01
    相关资源
    最近更新 更多