apache ssl 重定向到 FQDN 完好无损的子 url 路径?

发布于 2024-12-17 17:38:52 字数 760 浏览 2 评论 0原文

我试图在 Apache HTTP 服务器(httpd.conf)中完成的是将用户从默认页面 http://www.abc.com/ 重定向到 https://www .abc.com/xxx?var1=1&var2=2 这也保持 FQDN 完整。

我如何在 apache 中实现此功能? 以下是我在 httpd.cof 中的配置设置,该设置不起作用。


RedirectMatch 301 / https://%{HTTP_HOST}/webapp/wcs/stores/servlet/DMCInitialPageCmd?langId=-1& ;storeId=10001&catalogId=10051

  • 在IE浏览器上,测试url访问。例如:test.abc.com,如何正确显示主机名/FQDN?从浏览器获取此响应...

https://%25{http_host}/webapp/wcs/stores/servlet/DMCInitialPageCmd?langId=-1/ storeId=10001/catalogId=10051?langId=-1&storeId=10001&catalogId=10051

What I am trying to accomplish in Apache HTTP server (httpd.conf) is to redirect a user from a default page http://www.abc.com/ to https://www.abc.com/xxx?var1=1&var2=2 which also keeps FQDN intact.

How do I make this work in apache?
Below is my config setting in httpd.cof which is not working.


RedirectMatch 301 / https://%{HTTP_HOST}/webapp/wcs/stores/servlet/DMCInitialPageCmd?langId=-1&storeId=10001&catalogId=10051

  • on the IE browser, testing the url access. eg: test.abc.com, how do I correctly display the hostname/fqdn? getting this response from the browser...

https://%25{http_host}/webapp/wcs/stores/servlet/DMCInitialPageCmd?langId=-1/storeId=10001/catalogId=10051?langId=-1&storeId=10001&catalogId=10051

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

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

发布评论

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

评论(1

总以为 2024-12-24 17:38:52

怎么会失败呢?我不认为 RedirectMatch 接受变量扩展(如 %{HTTP_HOST})...为此,我通常使用 mod_rewrite

RewriteEngine On
RewriteRule ^/$ https://%{HTTP_HOST}/webapp/wcs/stores/servlet/DMCInitialPageCmd?langId=-1&storeId=10001&catalogId=10051 [R=301]

How is it failing? I don't think that RedirectMatch accepted variable expansion (like %{HTTP_HOST})...for this, I typically use mod_rewrite:

RewriteEngine On
RewriteRule ^/$ https://%{HTTP_HOST}/webapp/wcs/stores/servlet/DMCInitialPageCmd?langId=-1&storeId=10001&catalogId=10051 [R=301]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文