Apache服务器名称+虚拟主机configuration

我有一个运行在Apache Web服务器上的Oracle应用程序服务器(10.1.2)。 我们有多个在Oracle应用服务器的不同服务器实例上运行的网站。

我们有我们的虚拟主机如下。

服务器是webserver.companyname.com和虚拟主机我有以下

<VirtualHost *:80> ServerName www.example.com ServerAlias example.com *.example.com DocumentRoot "/oracle/app/oracle/product/101202/mid101202/Apache/Apache/htdocs" <Location /server-status> SetHandler server-status Order deny,allow Deny from all </Location> #uptohere </VirtualHost> #upto here <VirtualHost *:80> ServerName www.example1.com ServerAlias example1.com *.example1.com DocumentRoot "/oracle/app/oracle/product/101202/mid101202/Apache/Apache/htdocs2" #added by reyaz on 19th july 10 <Location /server-status> SetHandler server-status Order deny,allow Deny from all </Location> #uptohere </VirtualHost> 

现在一切运转平稳,但是当我键入www.example.com或www.example1.com时,我被redirect到实际的服务器path,这是http://webserver.companyname.com/example/index.html,http:// webserver.companyname.com/example1/index.html 。

我不希望发生这种情况,而是希望将其configuration为www.example.com/index.html。

正如你们现在所猜测的,我是Apache服务器的新手。 任何帮助深表感谢。

在上面的虚拟主机configuration中没有任何东西会导致你看到的问题,所以你的解决scheme在别处。 检查你的Apacheconfiguration,包括任何.htaccess文件,并寻找可以做到这一点的mod_rewrite指令。

所有你需要做的就是添加/example/example1到你的DocumentRootpath的末尾。 这将起作用,除非你还需要在/oracle/app/oracle/product/101202/mid101202/Apache/Apache/htdocs中提供文件,在这种情况下,你可以用Alias提供这些内容。