【发布时间】:2015-04-19 18:29:30
【问题描述】:
我的服务器上有一个客户的网站,客户有自己的域。
我想将源文件保留在我的服务器上,只是为了重定向客户域以显示来自我的服务器的网站内容。
- 客户域名:www.a.com
- 网站源文件:www.b.com/customer
我想在网络浏览器 www.a.com 中打开,显示来自 www.b.com/customer 的内容,但要将 www.a.com 保留在网络浏览器的地址栏中(包括来自 www.b.com 的子文件夹/客户)。
配置: 我正在使用托管服务器,无法编辑 apache 或 php 配置,源网站是用 CodeIgniter 编写的。在 CodeIgniter 中,我将 config.php 作为基本 URL:www.a.com。 www.a.com 在一台服务器上(我有 FTP 访问权限),根目录中有 .htaccess 文件:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^a.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.a.com [NC]
RewriteRule ^(.*)$ http://b.com/customer/$1 [L,R=301,NC]
在我的服务器上是 www.b.com/customer,在 /customer 文件夹中还有一个 .htaccess 文件:
RewriteEngine On
RewriteBase /customer
RewriteCond $1 ^(application|system|private|logs)
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
RewriteCond $1^(index\.php|robots\.txt|favicon\.ico|public|assets|css|js|images)
RewriteRule ^(.*)$ - [PT,L]
RewriteRule / index.php/$1 [PT,L]
在网络浏览器中隐藏“index.php”。 到目前为止一切正常,在调用 www.a.com 时,用户被重定向到 www.b.com/customer,页面正确显示。所有链接都显示为:“www.a.com/some_page.php”并且也可以正常工作。 唯一的问题是,在网络浏览器的地址栏中,用户看到的是“www.b.com/customer”。我想有'www.a.com/some_page.php' 这是详细的问题描述 - 请让我知道是否可以解决? 谢谢和最好的问候, 火石
【问题讨论】:
-
您好,这个还是没有解决。有人可以帮帮我吗?