Redirect to HTTPS for subfolder and relative links inside

Fix it!!

Redirect to HTTPS for subfolder and relative links inside

Postby danmcl » Tue Oct 21, 2008 1:51 am

Hi all, I'm trying to redirect a folder on a site (/shop) to HTTPS://
the redirect works fine but the images and other relative links (/shop/images or images etc) still appear to come from HTTP, as you can imagine this brings up the very irritating "Do you want to show insecure items" in IE

this is the rule I am using inside a <directory>
AllowOverride All
RewriteEngine On
RewriteCond %{HTTP:ssl} !=1
RewriteRule ^(.*) https://www.address.com/shop/$1 [R]

I've tried having multiple directories for all the different folders that need redirected but still the same.

This was my initial rule

AllowOverride All
RewriteEngine On
RewriteCond %{HTTP:ssl} !=1
RewriteRule ^/shop/(.*) https://www.address.com/shop/$1 [R]

which was in the main httpd.conf file.

Thanks in advance

Dan
danmcl
 
Posts: 1
Joined: Tue Oct 21, 2008 1:46 am

Postby richardk » Tue Oct 21, 2008 9:48 am

What are the paths in the source of your page like?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 3 guests

cron