htaccess的变化领域,但保持路径路径、领域、htaccess

2023-09-02 10:05:14 作者:一颗心的距离

我甚至不知道这是否是可以或不可以。

i don't even know whether this is possible or not.

我已经3的域名:

mytest.com test88.com test99.com

mytest.com test88.com test99.com

mytest.com是主域,所有的内容所在。在我的情况下,它是被安装在网络空间字preSS。

mytest.com is the main domain where all the content is located. in my case it is wordpress which is installed on that webspace.

我的htaccess的是这样的:

my htaccess looks like this:

RewriteEngine On    

RewriteCond %{HTTP_HOST} ^(.*)test88.com [nc]
RewriteRule ^(.*)$ http://%1mytest.com/wp/?page_id=10&test=test88 [R,L]

RewriteCond %{HTTP_HOST} ^(.*)test99.com [nc]
RewriteRule ^(.*)$ http://%1mytest.com/wp/?page_id=10&test=test99 [R,L]

我想保留域名,以防访问者去test88.com但我也想保持路径的其余部分。它应该是这样的,在地址栏: http://www.test.88.com/wp/?page_id = 10安培;测试= test88

i want to keep the domainname in case a visitor goes to test88.com but i also want to keep the rest of the path. It should look like this in the address-bar: http://www.test.88.com/wp/?page_id=10&test=test88

北京时间这可能吗?

在此先感谢

推荐答案

你想从mytest.com内容显示了test88.com和test99.com下,基本上创建副本?

Do you want the content from mytest.com show up under the test88.com and test99.com, basically creating duplicates ?

在这种情况下,你可能不希望mod_rewrite的重定向[R],但反向代理[PT]从主域的内容。

In that case you probably don't want to mod_rewrite to redirect [R], but to reverse-proxy [PT] the content from the main domain.

RewriteEngine On    

RewriteCond %{HTTP_HOST} ^(.*)test88.com [nc]
RewriteRule ^(.*)$ http://%1mytest.com/wp/?page_id=10&test=test88 [PT,L]

RewriteCond %{HTTP_HOST} ^(.*)test99.com [nc]
RewriteRule ^(.*)$ http://%1mytest.com/wp/?page_id=10&test=test99 [PT,L]

确认的mod_proxy 安装在你的Apache。

Make sure mod_proxy is installed on your Apache.

 
精彩推荐
图片推荐