+ -
当前位置:首页 → 问答吧 → apache 301重定向

apache 301重定向

时间:2011-08-04

来源:互联网

apache2.2+tomcat6 没有用jk 直接就是配置httpd.conf文件,实现了正常访问。现在想把几个域名做301到www.XXX.com,试过好几个方法都不行,.htaccess也没效果。
httpd.conf:

LoadModule rewrite_module modules/mod_rewrite.so

<Directory />
Options FollowSymLinks

  AllowOverride All

  Order deny,allow

  Deny from all
</Directory>

<VirtualHost *:80>
ProxyPass / ajp://127.0.0.1:8009/
ProxyPassReverse / ajp://127.0.0.1:8009/
ServerName www.XXX.com
ServerAlias www.XXX.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^http://XXX\.com
RewriteCond %{HTTP_HOST} ^http://bbb\.com
RewriteCond %{HTTP_HOST} ^http://www.bbb\.com
RedirectMatch permanent ^/(.*) http://www.XXX.com/$1
</VirtualHost>

请问,怎么就不能成功呢?需要怎么配置?

作者: chang2030   发布时间: 2011-08-04

试下用ErrorPage做内部跳转来进行重定向?

作者: jingluo   发布时间: 2011-08-08

热门下载

更多