所以我在同一个IP上有两个不同的站点。基本上我只想将流量从一个域引导到某个文件夹,然后从另一个域引导到另一个文件夹。我读了这个页面... http://httpd.apache.org/docs/2.0/vhosts/examples.html,并设置我的站点启用配置文件看起来像这样,但我的第二个域只是将流量路由到我的原网站。
所以... 域 1:cdphoto.uni.cc 域 2:wtfdoidoatubc.uni.cc
我的配置文件看起来像这样
感谢您的任何建议!
所以我在同一个IP上有两个不同的站点。基本上我只想将流量从一个域引导到某个文件夹,然后从另一个域引导到另一个文件夹。我读了这个页面... http://httpd.apache.org/docs/2.0/vhosts/examples.html,并设置我的站点启用配置文件看起来像这样,但我的第二个域只是将流量路由到我的原网站。
所以... 域 1:cdphoto.uni.cc 域 2:wtfdoidoatubc.uni.cc
我的配置文件看起来像这样
感谢您的任何建议!
在这种情况下,最好使用控制面板并添加重定向,除非您打算将网站的主要部分用于某些事情。但是,如果不是来自主机控制面板的重定向规则,那将是最好和最简单的选择。
我会尝试一下,并确保您注意到我对第一个文档根目录所做的更改。
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/cdp
ServerName www.cdphoto.uni.cc
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/cpd>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
<Location /trac>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/www/trac
PythonOption TracUriRoot /trac
</Location>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/wtf
ServerName www.wtfshouldidoatubc.uni.cc
</VirtualHost>
也许尝试使用 DocumentRoots /var/www/site1 和 /var/www/site2?现在第二个站点位于第一个站点的子文件夹中。如果您请求http://www.cdphoto.uni.cc/wtf会发生什么?