使用 ISAPI_rewrite 进行 URL_Rewriting

发布于 2024-08-12 07:54:12 字数 205 浏览 4 评论 0原文

我在 ISAPI_rewrite 3 中遇到问题。

a 有一个像

www.example.com/web/index.html?ag=2154

这样的网址我想要的是,当用户写入这个地址时,它应该转换为代理的子域,如

www.2154 .example.com/web/index.html?ag=2154

提前致谢

I have a problem in ISAPI_rewrite 3.

a have a url like

www.example.com/web/index.html?ag=2154

What I want is, when the user writes this address it should be converted to agent's subdomain like

www.2154.example.com/web/index.html?ag=2154

Thanks in advance

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

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

发布评论

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

评论(1

享受孤独 2024-08-19 07:54:12

您希望地址栏中的 URL 发生变化还是希望它“在幕后”进行转换?请尝试

RewriteBase /
RewriteCond %{QUERY_STRING} ^ag=(\d+)$ [NC]
RewriteRule ^web/index\.html$ http://www.%1.example.com%{REQUEST_URI} [NC,L]

或者

RewriteBase /
RewriteCond %{QUERY_STRING} ^ag=(\d+)$ [NC]
RewriteRule ^web/index\.html$ http://www.%1.example.com%{REQUEST_URI} [NC,P]

Do you want the URL in the address bar to change or do you want it to be converted "behind the scenes"? Please try either

RewriteBase /
RewriteCond %{QUERY_STRING} ^ag=(\d+)$ [NC]
RewriteRule ^web/index\.html$ http://www.%1.example.com%{REQUEST_URI} [NC,L]

or

RewriteBase /
RewriteCond %{QUERY_STRING} ^ag=(\d+)$ [NC]
RewriteRule ^web/index\.html$ http://www.%1.example.com%{REQUEST_URI} [NC,P]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文