可以使用 apache mod_rewrite 将 301 重定向到具有非“http”方案的 url和“https”?
尝试使用 apache mod_rewrite 进行 301 重定向:
RewriteRule /the-path/(.*) my-scheme://new-site.com/the-path/$1 [R=301,NC,L]
路径 http://site.com/the-path /param1=xyz 将重定向到 http://site.com/my-scheme ://new-site.com/the-path/param1-xyz
但是当我在重写规则中使用“http”或“https”代替“my-scheme”时,它按预期工作。
所以我猜 mod_rewrite 只能重定向到“http”或“https”。任何人都可以确认吗?谢谢
Trying to do a 301 redirect using apache mod_rewrite:
RewriteRule /the-path/(.*) my-scheme://new-site.com/the-path/$1 [R=301,NC,L]
The path http://site.com/the-path/param1=xyz will redirect to
http://site.com/my-scheme://new-site.com/the-path/param1-xyz
But when I use "http" or "https" in place of "my-scheme" in the rewrite rule, it is working as expected.
So I guess mod_rewrite can redirect to only "http" or "https". Anyone can confirm? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不仅仅是“http:”或“https:”,而是 非常接近。
Not just "http:" or "https:", but pretty close.