[英]htacess rewrite for AltoRouter to include redirect to https
我正在使用Altorouter,它需要在htacess中執行以下操作
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
這工作正常,但我還需要將http重定向到https。 我在網上找到了示例,但將兩者結合在一起的所有努力都失敗了。 如何將頂部片段與此結合?
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://example.com/$1 [R]
嘗試以下
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://yourdomain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.