我已经使用搜索和谷歌,但似乎无法找到解决方案。我试图将其重定向到HTTPS,但遇到一些问题。我不断收到:如何解决htaccess ssl https重定向?
ERR_TOO_MANY_REDIRECTS
下面是我的htaccess文件。我宁愿不要为每个html代码添加代码。我已经尝试了一切,只是无法弄清楚。
# Multiple Environment config
# Set this to development, staging or production
# SetEnv PYRO_ENV production
<IfModule mod_rewrite.c>
# Make sure directory listing is disabled
Options +FollowSymLinks -Indexes
# disable the Apache MultiViews directive if it is enabled on the server. It plays havoc with URL rewriting
Options -MultiViews
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RedirectMatch 403 ^/.*/(system/cms/cache|system/codeigniter|system/cms/config|system/cms/logs|\.git|\.hg).*$
# Send request via index.php (again, not if its a real file or folder)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_php5.c>
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
</IfModule>
编辑:问题解决了下面曾任职代码。请锁定
RewriteCond %{ENV:HTTPS} !on [NC]
RewriteRule ^(.*)$ https://mydomain(dot)com/$1 [R,L]
请你分享网址? – Avinash
http://gateway-webhosting.ca在这里你去:p – user3732612