我想在我的.htaccess
设置一些规则以特定的方式工作:htaccess的重写规则到https不起作用与其他规则组合
特定页面重定向:
RewriteRule "^web/site/mais$" https://www.main.com/front/for-you/insurance/ [R=301,L]
首页重定向
RewriteRule ^$ https://www.forexample.com.br/for-you/ [R=301,L] RewriteRule ^/$ https://www.forexample.com.br/for-you/ [R=301,L]
HTTP到HTTPS,并添加www会休息(这是不工作),我尝试了很多东西:
RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTPS} !^on$ [OR] RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule (.*) https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{HTTP_HOST} ^www\. RewriteCond %{HTTPS} !^on$ [OR] RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
其他办法我试过forgotting了www规则(但不工作太):
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
,我发现是书面方式一般https
和www
规则在httpd.conf
和其他规则到.htaccess
结合的唯一途径,但这样一来,我得到两个或两个以上301重定向,不良商家为SEO。
是的,我有代理通行证images,js和css,将www的具体内容写入到ssl.conf和htaccess中,并且仅将httpd.conf写入代理服务器的图像,js和css,ir适用于我。我使用的规则是: ssl.conf在代理服务器下,向下.htaccess: 'RewriteCond%{HTTP_HOST}!^ www \。 RewriteRule(。*)https://www.% {HTTP_HOST}%{REQUEST_URI} [R = 301,L]' –