mod_rewrite 主机名上的本地重定向

发布于 2024-09-25 17:23:20 字数 270 浏览 1 评论 0原文

不知道你是否可以帮助我,

我有一个托管帐户(在 GoDaddy 上为我的罪过),该帐户有一个与之关联的域名和多个停放的域名。

如果我访问:

site1.com site2.com site3.com

我获取 /httpdocs/ 的内容,

我只想重定向到子目录(本地),这样如果您转到 site2.com,URL 仍为 site2.com,但内容是从 /httpdocs/site2 加载的。 com/.

我怎样才能做到这一点?

wonder if you can help me,

I've got a hosting account (on GoDaddy for my sins) which has one domain name associated with it and a few more parked.

If I visit:

site1.com
site2.com
site3.com

I get the contents of /httpdocs/

I want to redirect to a sub directory (locally) only so that if you goto site2.com, the URL stays as site2.com but the content is loaded from /httpdocs/site2.com/.

How can I acheive that?

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

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

发布评论

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

评论(1

予囚 2024-10-02 17:23:20
RewriteCond %{HTTP_HOST} site2.com
RewriteCond %{REQUEST_URI} !^/site2.com
RewriteRule ^(.*)$ site2.com/$1 [L]
RewriteCond %{HTTP_HOST} site2.com
RewriteCond %{REQUEST_URI} !^/site2.com
RewriteRule ^(.*)$ site2.com/$1 [L]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文