1

我的一个网站面临重定向严重性。就这个 -

我必须将http://local.port-all/antique/c-Furniture/m-Antique-Dining-Room-Tables.html重定向 到http://local.port-all/antique-c-Furniture-m-古董+餐厅+房间+桌子.html

所以我写了htaccess重定向

    Redirect /antique/c-Furniture/m-Antique-Dining-Room-Tables.html /antique-c-Furniture-m-Antique+Dining+Room+Tables.html

所以它重定向到特定的url。但是该站点有一个默认规则集,

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

因此,当我的重定向工作时,它会在重定向 url 的末尾添加路由。这意味着重定向后它显示

    http://local.port-all/antique-c-Furniture-m-Antique+Dining+Room+Tables.html?_route_=antique/c-Furniture/m-Antique-Dining-Room-Tables.html

但我只需要

    http://local.port-all/antique-c-Furniture-m-Antique+Dining+Room+Tables.html

在我没有得到的重定向之后。我不能删除

    _route_ from RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] 

因为它创建了站点的默认路由访问。所以我需要不同的解决方案。

请帮忙。

提前致谢

4

0 回答 0