如何使用.htaccess将一个URL重定向到另一个URL?

发布于 2025-01-25 13:23:29 字数 423 浏览 1 评论 0原文

我被困在将一个URL重定向到另一个URL上。

我想重定向

https://samedomain.com/page-check-927GSJAYS639AL/highlights

https://samedomain.com/page-highlights/

(927GSJAYS639AL这是ID,它可以是

任何

东西

RewriteEngine On
RewriteBase /
RewriteRule ^page-check-([A-Z0-9]*)/highlights /page-highlights/?id=$1 [L]

)错误页面的

任何帮助将受到高度赞赏。提前致谢。

I am stuck at redirecting one url to another url.

I want to redirect

https://samedomain.com/page-check-927GSJAYS639AL/highlights

to

https://samedomain.com/page-highlights/

(927GSJAYS639AL this is id it can be anything)

the http://samedomain.com/page-highlights/ is the wordpress page

The rewrite rule I tied is:

RewriteEngine On
RewriteBase /
RewriteRule ^page-check-([A-Z0-9]*)/highlights /page-highlights/?id=$1 [L]

but i see 404 error page

Any help is highly appreciated. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文