为了增强代理,我需要在查询参数中重写域名。代理基本上只是一个域重写,但是来自上游服务器的一些响应包含一个查询参数,该参数最终被用作重定向(在"Location“报头中)。我需要能够重写这个域名,以便它指向代理而不是上游服务器。我的当前配置如下
<VirtualHost *:443>
SSLEngine On
SSLProxyEngine On
# Set the path to SSL certificate
# Usage: SSLCertificateFile /path/to/cert.pem
SSLCertificateFile /etc/apache2/ssl/
我在apache上安装了ubuntu服务器。Everythink运行良好。现在我有8个域名。一个是与虚拟主机链接的。让我们称它为maindomain.com。其他7个域链接到另一个虚拟主机,让我们称其为linked darydomain1.com to linked Darydomain7.com。
我需要这7个域名被重定向到主域。/之后的所有内容都必须重定向到基域。例如,次域名2.com/file.php将被重定向至maindomain.com
有没有人能教我怎么用.htaccess文件呢?
我试过这样的东西,但它不起作用。
RewriteEngine On
RewriteBase /
Re
当我尝试安装后重新启动时,Apache无法完全确定域名。
我得到了这个错误;
$ sudo /etc/init.d/apache2 restart
Restarting web server config apache2
apache2: Could not reliably determine the server's fully qualified domain
name, using 127.0.1.1 for ServerName.
为什么我看到127.0.1.1?我尝试将ServerName localhost保存到我的/etc/init.d/apache2中,但每次输入ph