asp.net php asp jsp 301重定向的代码(集合)(3)
RewriteEngine On
RewriteCond %{HTTP_HOST} !olddomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
4.重定向olddomain.com to newdomain.com
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !olddomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
5.重定向domain.com/file/file.php 到 otherdomain.com/otherfile/other.php
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^file/file.php$ http://www.otherdomain.com/otherfile/other.php [R=301,L]
内容版权声明:除非注明,否则皆为本站原创文章。