.htaccess重定向到端口8000上的子域而不更改URL?

时间:2012-10-11 22:02:33

标签: php .htaccess redirect

我们在网站的子域上托管了一个地图应用程序,我们希望能够从网址http://www.example.com/map/访问

问题是子域托管在不同的服务器上,而地图应用程序位于端口8000上。

有没有办法从主域上的/map/重定向到地图应用程序,而不使用.htaccess或PHP更改URL?

此外,我无权访问托管地图应用程序的服务器。

1 个答案:

答案 0 :(得分:3)

www.example.com

的vhost / server配置中使用mod_proxy
ProxyPass /map http://subdomain:8000/
ProxyPassReverse /map http://subdomain:8000/

在vhost / server htaccess文件中使用mod_rewrite移交给mod_proxy:

RewriteEngine On
RewriteRule ^/?map/(.*)$ http://subdomain:8000/ [L,P]
ProxyPassReverse /map http://subdomain:8000/
相关问题