基本上我有兩個不同的規則/任務,這些規則/任務應該組合在一組規則中。.htaccess組合規則(將非ssl重定向到ssl和exections)
任務1
所有非SSL頁面都被重定向到SSL。我的解決方案已經在自己的工作。
假人例如:
非SSL://sample.some-website.ch/de/test.html - > SSL://sample.some-website.ch/de/test.html
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^sample.some-website.ch$
RewriteRule ^(.*)$ "https\:\/\/sample\.some\-website\.ch\/$1" [R=301,L]
任務2
所有舊的一個.phtml鏈接都被重定向到新的SSL頁面(單獨)。我的解決方案是自己開發的(2個虛擬示例)
non-ssl://sample.some-website.ch/xyz.phtml - > ssl://sample.some-website.ch/de/newlink html的 非SSL://sample.some-website.ch/123.phtml - > SSL://sample.some-website.ch/en/something.html
redirect 301 /xyz.phtml https://sample.some-website/de/newlink.html
redirect 301 /123.phtml https://sample.some-website.ch/en/something.html
問題
我需要一個結合了任務1和任務2的.htaccess解決方案。 某些舊的.phtml(非ssl)鏈接必須重定向到新的特定SSL頁面AND所有'其他正常'非SSL鏈接必須自動重定向到其對應的SSL頁面。 最後只顯示ssl頁面。
任何想法? 謝謝。漢斯。
你能展現完整的.htaccess? – anubhava 2014-10-27 13:55:21
https://www.dropbox.com/s/kn3mtgwe2y7zahc/htaccess-code.txt?dl=0 – Strandel 2014-10-27 14:56:40