apache域名重定向rewrite

SOASPX 593 0

访问域名redmine.xx.com 跳转到redmine.xx.net

<VirtualHost *:80>
        ServerName  redmine.xx.com
#       ServerAlias redmine.xx.com
        DocumentRoot /var/www/app/redmine/public/
        ErrorLog logs/redmine_error_log
        <Directory /var/www/app/redmine/public/>
                Options -MultiViews
                Options ALL
                Order allow,deny
                Allow from all
                AllowOverride All
        </Directory>
        <IfModule mod_rewrite.c>
        RewriteEngine on 
#       RewriteCond %{HTTP_HOST} ^redmine.xx.com [NC]
        RewriteRule ^(.*) http://redmine.xx.net$1 [R=301,L]
        </IfModule>
</VirtualHost>
<VirtualHost *:80>
        ServerName  redmine.xx.net
        DocumentRoot /var/www/app/redmine/public/
</VirtualHost>

标签: Apache URL重写 rewrite

发表评论 (已有0条评论)

还木有评论哦,快来抢沙发吧~