我正在尝试屏蔽/隐藏我们 VPS 的 URL,我们在其中的子目录下安装了一个 wordpress 博客 (/var/www/vhosts/vps.url.com/httdocs/blog.
我们有一个指向该站点的域 (vps.url/blog),因此在浏览器上写入域 URL 会将我们重定向到 VPS,但会显示 URL vps.url/blog。
我试图以这种方式用 apache2 虚拟主机掩盖它:
<VirtualHost *:7080>
ServerAdmin webmaster@localhost
ServerName domain.es
ServerAlias www.domain.es
DocumentRoot /var/www/vhosts/vps.url.com/httpdocs/domain/
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
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 ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/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>
</VirtualHost>
这不起作用,因为当我们想要显示 domain.es 时它仍然显示 vps.url.com/domain
事先感谢并原谅我的英语不好。