【发布时间】:2014-05-30 00:23:39
【问题描述】:
我很难将所有 www 请求重定向到 apache 中的 http。
在 http.conf 我有:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(([a-z0-9_]+\.)?test\.pt/.*)$
RewriteRule .? http://%1%{REQUEST_URI} [R=301,L]
然后我配置了以下虚拟主机配置:
<VirtualHost *:80>
ServerAdmin xxx@yyy.pt
ServerName test.pt
DocumentRoot "/var/www/html/testjoomla"
</VirtualHost>
因此,如果我尝试访问:www.test.pt 或 www.test.pt/index.php/pt/ 它运行良好,它会重定向到 http://test.pt 或 http://test.pt/index.php/pt/ 但是如果我尝试访问 www.test .pt/index.php/pt 不起作用它保留 www.test.pt/index.php/pt ... 任何人都可以提供任何帮助吗?
最好的问候
【问题讨论】:
-
能否给我们看一下重写引擎的日志,如in the httpd manual解释的那样?
标签: apache apache2 virtualhost httpd.conf