Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php .htaccess是否在不更改URL的情况下重定向到端口8000上的子域?_Php_.htaccess_Redirect - Fatal编程技术网

Php .htaccess是否在不更改URL的情况下重定向到端口8000上的子域?

Php .htaccess是否在不更改URL的情况下重定向到端口8000上的子域?,php,.htaccess,redirect,Php,.htaccess,Redirect,我们有一个地图应用程序托管在我们网站的子域上,我们希望能够从URL访问该子域 问题在于子域托管在不同的服务器上,而映射应用程序位于端口8000上 是否有任何方法可以在不更改URL的情况下,使用.htaccess或PHP从主域上的/map/重定向到地图应用程序 此外,我无法访问地图应用程序所在的服务器。使用mod_代理,在www.example.com的vhost/server配置中 ProxyPass /map http://subdomain:8000/ ProxyPassReverse /m

我们有一个地图应用程序托管在我们网站的子域上,我们希望能够从URL访问该子域

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

是否有任何方法可以在不更改URL的情况下,使用.htaccess或PHP从主域上的
/map/
重定向到地图应用程序


此外,我无法访问地图应用程序所在的服务器。

使用mod_代理,在www.example.com的vhost/server配置中

ProxyPass /map http://subdomain:8000/
ProxyPassReverse /map http://subdomain:8000/
在vhost/server或htaccess文件中,使用mod_rewrite切换到mod_代理:

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

如果其他所有操作都失败,您可以始终使用iframe。这就是反向代理的用途。