我检查了其他htaccess问题和答案,但似乎没有任何东西适用于这种情况。
以下代码是我当前的htaccess文件。有一个主页的重定向到位,我需要保留。我有网站的SSL密钥和证书,我只需要将http更改为https。
我确信这并不复杂,这只是出于我目前的知识。
请帮忙!
RewriteEngine on
RewriteCond $1 !^(index\.php|admin|gadgets|images|editor|user_guide|captcha|system|css|utils|src|themes|tools|xinha|uploads|js|robots\.txt)
RewriteRule ^(.*).html /$1 [L]
RewriteCond %{HTTP_HOST} ^startuptoolshop\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.startuptoolshop\.com$
RewriteRule ^/?$ "http\:\/\/startuptoolshop\.com\/index\.php\/categories" [R=301,L]
答案 0 :(得分:0)
在RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
答案 1 :(得分:0)
将此代码放在.htaccess文件中:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}