您的位置:首页 > 运维架构 > Apache

apache域名重定向rewrite

2015-10-23 18:44 639 查看
访问域名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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: