使用.htaccess从URL中删除/放大(Remove /amp from URL with .htaccess)

编程入门 行业动态 更新时间:2024-10-13 22:19:08
使用.htaccess从URL中删除/放大(Remove /amp from URL with .htaccess)

我需要使用.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$ /$1

You can use this Redirect

RedirectMatch 301 ^/(.+)amp$ /$1

更多推荐

本文发布于:2023-08-02 09:01:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1372369.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:URL   htaccess   amp   Remove

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!