Apache 301跳转

配置apache支持.htaccess

AllowOverride All

配置.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
#www跳转到不带www
rewritecond %{HTTP_HOST} www.gaojie.me [NC]
RewriteRule ^(.*)$ https://jeff.xin/$1 [L,R=301]
#http跳转到https
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R=301,L]
</IfModule>

本文链接:https://jeff.xin/post/90.html

--EOF--

Comments

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。