PHP 301 跳转

RewriteBase /
跳转目的

RewriteCond %{http_host} ^cvicv.com [NC]

需要跳转的网站:
RewriteRule ^(.*)$ http://www.cvicv.com/$1 [L,R=301]
RewriteRule ^(.*)$ http://www.hcmain.com/$1 [L,R=301]
RewriteRule ^(.*)$ http://hcmain.com/$1 [L,R=301]

 

复制代码的时候把中文去掉~

 

永久做301

RewriteEngine On

RewriteCond %{HTTP_HOST} ^cvicv\.com$ [NC]
RewriteRule ^(.*)$ https://www.cvicv.com/$1 [L,R=301]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [R=301,L]

做443

RewriteEngine On

RewriteCond %{HTTP_HOST} ^cvicv\.com$ [NC]
RewriteRule ^(.*)$ https://www.cvicv.com/$1 [L,R=301]

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]

 

Comments

发表回复

Your email address will not be published. Name and email are required