Reputation: 95
i use this code
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
to redirect all request to HTTPS and that is ok.
Now I want same thing except one file index810.php
when i write like this
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^ index810.php
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
i get too many redirects, any suggestions.
Thank you in advance
Upvotes: 1
Views: 2590
Reputation: 586
The accepted answer didn't work for me. This did however:
RewriteCond %{THE_REQUEST} !/index810\.php [NC]
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}
Upvotes: 0
Reputation: 4010
A solution is to use a non rewriting rule:
# do nothing for /index810.php
RewriteRule ^index810\.php$ - [L]
# else ...
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}
Your pattern was wrong:
=/index810.php
)Upvotes: 5