RewriteRule .htaccess help!

The following code is in my .htaccess, and currently works - the first two lines are for if a user goes to example.com/Pancake, example.com/Pan-cake, example.com/pan-cake, or example.com/pancake, it takes them all to example.com/Pan-cake/index.php.

The last line is for if a user goes to example.com/pancake/whatever.php, it redirects it to example.com/Pan-cake/whatever.php.
The problem is if I try to add the line

RewriteRule ^Pan\\-cake(.*) http://www.example.com/Pan-cake$1 [NC,L]

I get an error “Firefox has detected that the server is redirecting the request for this address in a way that will never complete.”

What line should I write so that example.com/pan-cake/whatever.php redirects to example.com/Pan-cake/whatever.php?

RewriteRule ^Pan\\-cake$ http://www.example.com/Pan-cake/index.php?ref=stype [NC,L]
RewriteRule ^Pancake$ http://www.example.com/Pan-cake/index.php?ref=stype-nd [NC,L]
RewriteRule ^Pancake(.*) http://www.example.com/Pan-cake$1 [NC,L]

tls,

Indeed, the dot character (regex for anything) is NOT case sensitive! Reserve the No Case flag for use on the {HTTP_HOST} and you’ll be a long way ahead of the game.

Regards,

DK

That was it! Make the p lowercase, and removed NC from that line. However, I removed NC from the other lines, and that did make them case sensitive, which I did not want. But having NC, and a upper case P, was indeed the problem. Thanks!

tls,

Simple, make the P in the regex a p (and dump the unnecessary \). Of course, the NC flag will be the next culprit in your series of problems so get rid of that (it’s designed to be used against the {HTTP_HOST} which is case INsensitive, not against {REQUEST_URI} which IS case sensitive - same with your other RewriteRules!

Regards,

DK