I am having problem with a mod_rewrite redirect from http:// to https:// for my login and register pages. It redirects as expected but the included css file on the https:// pages does not work when viewing the page in Google Chrome on my Mac. On these pages i am calling the https:// version of the css file and all other included resources. If i navigate to the https:// version of these pages without the mod_rewrite code it brings in the css file as expected. It seems the mod_rewrite is having a conflict somewhere. It works fine in other browsers.

Anyone know what's going on with all this?


Options +FollowSymLinks
RewriteEngine On

# redirect non www. to www. domain

RewriteCond %{HTTP_HOST} ^mysite.com
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]

# My server automatically adds a PHP Session ID to URL's so this needs to be switched off

php_flag session.use_trans_sid off
php_flag session.use_only_cookies on

# force https secure URL for sensitive pages
RewriteCond %{HTTPS} !on
RewriteCond %{SCRIPT_FILENAME} (login|register).php$
RewriteRule (.*) https://www.mysite.com/$1 [R,QSA,L]

# force http:// non-secure URL for normal pages
RewriteCond %{HTTPS} on
RewriteCond %{SCRIPT_FILENAME} !(login|register).php$
RewriteRule (.*) http://www.mysite.com/$1 [R,QSA,L]

# Mod Rewrite URL's
# News
RewriteRule news/([A-Za-z0-9-]+)-([0-9]+) news/index.php?dynamic_url=$1&row_id=$2
# Articles
RewriteRule nutrition-advice/([A-Za-z0-9-]+)-([0-9]+) nutrition-advice/index.php?dynamic_url=$1&row_id=$2
# Farmer
RewriteRule your-farmers/([A-Za-z0-9-]+)-([0-9]+) your-farmers/index.php?farmer_url=$1&row_id=$2

# Remove the file extension from URL's.  THIS MUST BE PLACED AFTER THE MOD REWRITE CODE
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]