我想在我的.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]' –