【发布时间】:2015-07-30 21:54:52
【问题描述】:
我在 http-host/subdir1/subdir2/siterootdir 之类的子文件夹中安装了一个 Magento 站点。
现在我想缩短我的品牌页面的相当长的 URL,如下所示:
请求网址:http://hostname/subdir1/subdir2/siterootdir/brands/brandname.html
到
原网址:http://hostname/subdir1/subdir2/siterootdir/brands/index/brandsproduct/brand/brandname
htaccess 使用动态查询字符串重定向。
我尝试了许多来自谷歌搜索的示例,但是当我运行所需的请求 URL(如上)时,我不断收到 404 not found 页面。
另外我不太擅长正则表达式和重写规则/条件,所以任何人都可以为上述问题提供解决方案并解释其背后的细节吗?
请注意,brandname 当然是动态的。
【问题讨论】:
标签: regex .htaccess magento redirect