htaccess重写规则

发布于 2024-08-29 17:53:51 字数 393 浏览 1 评论 0原文

我目前有这条规则,我希望页面只呈现我的静态内容。

RewriteRule ^videos\/coverage\/view\/236159\-([0-9a-zA-Z-]+) http: //website.com/static/236159.html [NC]

然而,这不起作用。它适用于 L 标签,但 URL 不同:

RewriteRule ^videos\/coverage\/view\/236159\-([0-9a-zA-Z-]+) http: //website.com/static/236159.html [L, NC]

我的目标是保持 URL 相同但内容不同。谁能指出需要哪些标志才能使其正常工作?

谢谢!

I currently have this rule where I want the page to just render my static content.

RewriteRule ^videos\/coverage\/view\/236159\-([0-9a-zA-Z-]+) http: //website.com/static/236159.html [NC]

However, this doesn't work. It works with a L tag but then the URL is different:

RewriteRule ^videos\/coverage\/view\/236159\-([0-9a-zA-Z-]+) http: //website.com/static/236159.html [L, NC]

My goal is to keep the URL the same but the content different. Can anyone point out to what flags are needed in order to get this working properly?

Thanks!

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

街角卖回忆 2024-09-05 17:53:51

如果您位于同一台计算机上,请使用相对 URI:

RewriteRule ^videos/coverage/view/236159-([0-9a-zA-Z-]+)$ static/236159.html [NC]

If you stay on the same machine, use relative URIs:

RewriteRule ^videos/coverage/view/236159-([0-9a-zA-Z-]+)$ static/236159.html [NC]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文