I've done this before successfully, so it confuses me that I'm failing at it now. My goal is to make any attempt at a non-https URL redirect to its https counterpart except for files in the /images/ directory, since those will be used in some emails. Instead, the .htaccess file below is causing browsers to attempt an infinite loop of redirection, ultimately hitting an ERR_TOO_MANY_REDIRECTS error. That behavior could imply that I had forgotten the first RewriteCond termination condition below, except that I hadn't. Thanks in advance for your help! Code: RewriteEngine On RewriteBase / DirectorySlash On # Force https: on everything except images: (e.g., for emails) RewriteCond %{HTTPS} off RewriteCond %{SCRIPT_FILENAME} !^/images(/|$) RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,QSA,L]
URL redirection going in circles
6
I've done this before successfully, so it confuses me that I'm failing at it now. My goal is to make any attempt at a non- URL redirect to its counterpart except for files in the directory, since those will be used in some emails. Instead, the file below is causing browsers to attempt an infinite loop of redirection, ultimately hitting an error. That behavior could imply that I had forgotten the first termination condition below, except that I hadn't. Thanks in advance for your help!
Code:
RewriteEngine On
RewriteBase /
DirectorySlash On
# Force https: on everything except images: (e.g., for emails)
RewriteCond %{HTTPS} off
RewriteCond %{SCRIPT_FILENAME} !^/images(/|$)
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,QSA,L] - RobinInTexas
- [ 1 ] Thanks
- [1] reply
- David Beroff
- SteveJohnson
- [ 1 ] Thanks
- [1] reply
- David Beroff
- [1] reply
Next Topics on Trending Feed
-
6