1

I have a problem with a redirect in my .htaccess-File. Basically I want to send all requests to the HTTPS, which works perectly:

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.domain.de/$1 [R,L]

Now I need the exception for a few images: For example, when its /fileadmin/rss.png it has to be http://www.domain.de/fileadmin/rss.png and not the HTTPS version. Whatever I've tried so far, nothing worked. For example; I've added a RewriteCond %{SERVER_PORT} 443 at the front and set the RewriteRule for the specific image. But still, the redirect was set to HTTPS. Any ideas?

1 Answer 1

4
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/fileadmin/rss\.png$
RewriteRule (.*) https://www.domain.de/$1 [R,L]

Be sure you're familiar with the mod_rewrite documentation.

1
  • Ahhh! I've tried to make seperate redirects for those and probably the first one had a higher priority than the ones below. Thank you so much! :) Commented Feb 11, 2014 at 9:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .