简体   繁体   English

Web应用程序根据URL重定向到子目录

[英]Webapplications redirect to subdirectory based on URL

I have two webapplications on my apache webserver. 我的apache网络服务器上有两个Web应用程序。

/var/www/APP1 /var/www/APP2 / var / www / APP1 / var / www / APP2

Server = 1 IP Address. 服务器= 1个IP地址。

Is it possible to connect multi URLS (www.test.com, www.secondtest.com) to my webapps. 是否可以将多个URL(www.test.com,www.secondtest.com)连接到我的Web应用程序。

www.test.com --> /var/www/APP1 www.secondtest.com --> /var/www/APP2 www.test.com-> / var / www / APP1 www.secondtest.com-> / var / www / APP2

is it possible with htaccess? htaccess有可能吗? Or how can I fix it? 或者我该如何解决?

Not sure why you would want to do this. 不知道为什么要这么做。 The better option would be to use multiple VirtualHosts ( http://httpd.apache.org/docs/2.2/vhosts/examples.html ). 更好的选择是使用多个VirtualHosts( http://httpd.apache.org/docs/2.2/vhosts/examples.html )。

This allows you to map each domain directly to the location the files are located in. 这使您可以将每个域直接映射到文件所在的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM