我需要使用.htaccess从某个URL结构中删除/ amp。 我的传入链接看起来像这样:
https:// domain / store / amp和https:// domain / store / product / amp
在这两种情况下,最后的/ amp都会导致404错误。 我只需要摆脱它,因为在源头修复问题目前不是一个选择。 我打算将.htaccess放在/ store /目录路径中。
我已经四处寻找类似的例子,并尝试修改它们,但重写使我的头部在短时间内旋转。 谢谢您的帮助。
I need to use .htaccess to remove /amp from a certain URL structure. I have incoming links that look like this:
https://domain/store/amp and https://domain/store/product/amp
In both cases, the /amp on the end results in 404 errors. I just need to get rid of it, because fixing the problem at the source is not currently an option. I intend to put the .htaccess in the /store/ directory path.
I have looked around for similar examples and tried to modify them, but rewrites make my head spin in short order. Thanks for the help.
最满意答案
您可以使用此重定向
RedirectMatch 301 ^/(.+)amp$ /$1You can use this Redirect
RedirectMatch 301 ^/(.+)amp$ /$1更多推荐
发布评论