【发布时间】:2011-09-05 17:18:18
【问题描述】:
我目前正在尝试将 RewriteRule 放入我的 Magento 网站的 .htaccess 文件中,这将允许我以以下方式编写类别 URL:
http://mydomain.com/dir/<direction>/order/<order>/<Magento category URL path>.html
我基本上想做的是使用我的 robots.txt 文件使某些类别 URL 不出现(特别是当您对类别应用不同的排序顺序时)。
假设我有以下网址:
http://mydomain.com/dir/asc/order/sales_index/footwear/mens-work-boots/motorcycle-boots.html
我希望它像 URL 一样呈现:
http://mydomain.com/footwear/mens-work-boots/motorcycle-boots.html?dir=asc&order=sales_index
我在 .htaccess 文件中的代码如下:
RewriteRule ^dir/(.*?)/order/(.*?)/(.*?)$ $3.html?dir=$1&order=$2
由于某种原因,当我把它放在那里时,我收到了 404 错误。有人可以为我指明正确的方向吗?
【问题讨论】:
标签: apache .htaccess mod-rewrite magento