我目前是這樣子寫 .htaccess
# Redirect to HTTPS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
原本只有寫# Redirect to HTTPS,但發現沒有帶入 # Clean URLs 後台功能的連結會出問題
目前運作正常沒問題。只不過,不知道這樣子寫對不對,想問一下大家都怎麼寫?
PS.網站是放在Webhosting