本文介绍了如何重定向到example/ www.example/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在这个code我国的.htaccess 文件,如下图所示。
I have this code in my .htaccess file as shown below.
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) %{HTTP_HOST}%{REQUEST_URI}这被添加到HTTP重定向到https所以整个网站现在是HTTPS版本。
This was added to redirect http to https so the entire site is now in https version.
现在我想从非www到www重定向。当我键入example我应该被重定向到 www.example/
Now I want to redirect from non-www to www. When I type example I should be redirected to www.example/
我如何做到这一点与的.htaccess 文件?
How do I do that with an .htaccess file?
推荐答案非SSL重定向:结果
RewriteEngine on RewriteCond %{HTTP_HOST} ^domain\ RewriteRule ^(.*)$ www.domain$1 [R=permanent,L]SSL重定向:结果
SSL redirection:
RewriteEngine on RewriteCond %{HTTP_HOST} ^domain\ RewriteRule ^(.*)$ www.domain$1 [R=permanent,L]更多推荐
如何重定向到https://example.com/ https://www.example.com/
发布评论