访问域名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配置文件实现从redmine.xx.com到redmine.xx.net的301永久重定向。通过设置VirtualHost及RewriteRule指令,确保网站访问者能够被无缝引导至新的域名地址。
789

被折叠的 条评论
为什么被折叠?



