我有一个房贷计算器,似乎从mookal重定向网站并不www.mookal结果我的Apache配置如下:
I have a mortgage calculator site that doesn't seem to redirect from mookal to www.mookal My apache config is as follows:
RewriteEngine On ### re-direct to www RewriteCond %{http_host} !^www.mookal [nc] RewriteRule ^(.*)$ www.mookal/$1 [r=301,nc]我是什么失踪?
推荐答案使用重写引擎是解决这个问题的一个pretty重量级方式。这里有一个简单的解决方案:
Using the rewrite engine is a pretty heavyweight way to solve this problem. Here is a simpler solution:
<VirtualHost *:80> ServerName example Redirect permanent / www.example/ </VirtualHost>然后你就会有另一个&LT;虚拟主机&GT; 第服务器名称www.example 为您真正的服务器配置。 Apache的自动preserves后,任何东西使用重定向指令,这就是为什么这是一个普遍的误解时, / 方法是不行的(而事实上它)。
And then you'll have another <VirtualHost> section with ServerName www.example for your real server configuration. Apache automatically preserves anything after the / when using the Redirect directive, which is a common misconception about why this method won't work (when in fact it does).
更多推荐
阿帕奇非WWW到www重定向
发布评论