Htaccess想要在url中剪切文件夹


htaccess want to cut folder in url

我正在寻找一个htaccess规则,它现在在一个url中削减文件夹名,当我点击搜索后的产品时,我得到了一个404路径列表

DOMAIN.COM/magento/index.php/catalog/product/view/s/sony-ericsson-w810i/

我想要的是点击并得到这个路径:

域:COM/magento/index.php/sony-ericsson-w810i.html

所以它只是关于削减目录/产品/视图/s/部分....这部分是静态的,但后面的名字(在这里是手机)是动态的…

谁能给我正确的访问重写规则?

谢谢你

下面的规则应该能达到你想要的效果

RewriteRule ^magento/index.php/catalog/product/view/s/(.*)$ /magento/index.php/$1.html [R=302,L]

当您确定重定向工作时,将R=302更改为R=301