如何将 www.domain.com 重写为另一个域的 /www/domain.com/index.php?

发布于 2024-09-07 18:47:58 字数 232 浏览 1 评论 0原文

我目前的 htaccess 上有这个:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/www/
RewriteRule (.*) /www/$1/index.php

但我不断收到错误页面

我想做的是为客户注册很多域名 并将他们网站的所有文件存储在我的域的 www 文件夹中名为“irdomain.com”的文件夹中。

i have this on my htaccess currently:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/www/
RewriteRule (.*) /www/$1/index.php

but i keep getting an error page

what im trying to do is to register a lot of domains for clients
and just store all their websites' files on a folder named "theirdomain.com" on my domain's www folder.

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

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

发布评论

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

评论(1

空‖城人不在 2024-09-14 18:47:58

首先你永远不会在URI中找到www,因为URI是index.php之后的所有内容?所以uri将是index.php?/here/is/the.uri/string

我会查看HTTP_HOST

<IfModule mod_rewrite.c>
   RewriteCond %{HTTP_HOST} !^first-host.com$ [NC]
   RewriteRule ^(.*)$ http://new-host.com/$1 [L,R=301] #Send 301 so search engines know where to go.
</IfModule>

Firstly you will never find www in the URI BEcause the URI is everything after index.php? so the uri will be index.php?/here/is/the.uri/string

I would look at HTTP_HOST

<IfModule mod_rewrite.c>
   RewriteCond %{HTTP_HOST} !^first-host.com$ [NC]
   RewriteRule ^(.*)$ http://new-host.com/$1 [L,R=301] #Send 301 so search engines know where to go.
</IfModule>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文