mod_rewrite And Browser Caching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've been working at this for days and couldn't figure out why a mod_rewrite rule wasn't working.  My situation was that I wanted to redirect this:

http://domain.com/unique_directory/whatever

to

https://domain.com/unique_directory/whatever

While not redirecting http://domain.com/other_directories/whatever

After beating my head for a few days and realizing first attempts were creating a rewrite loop, I finally came up with this syntax:

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteCond %{REQUEST_URI} \/unique_directory\/ [NC]

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Yet on the PC I had been using for testing, the redirects were still failing using both Firefox 14 and Internet Explorer 9.  I had many tabs open in Firefox so I never closed and reopened it but I did close and reopen IE9.  Attempts to load pages still timed out just like when I had the rewrite loop in place.

Also, I had enabled the RewriteLog for debugging with RewriteLogLevel 9.  I thought it odd that I would not see requests from my IP address hitting the rewrite log.

Finally in desperation, I went to another PC and tested with the same browsers.  Redirection worked just as I expected it to and I could see those in the rewrite log.

So now I'm trying to understand how browsers cache information and what it takes to get them to forget that information.

Thanks in advance.

Cheers,

Drew
-- 
Like card tricks?

Visit The Alchemist's Warehouse to 
learn card magic secrets for free!

http://alchemistswarehouse.com

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux