Subdomains and .htaccess
I recently had real issue. I have a shopping cart. The cart configuration sets the entire function at domain.com/shop
One day while fiddling around with .htaccess I decided to use it to force www (lots of good reasons to do that) on the main site (domain.com) Weeeeellll, it took about a week for me to discover that the shopping cart was NOT functioning properly. Why? Because all the configuration for the cart was for domain.com (as opposed to www.domain.com) and it jacked the entire thing UP.
Also note that the links to the ’shop’ were all domain.com. So, since I couldn’t exactly go out on the world wide web and change them all, I decided to use htaccess to adjust this conundrum I’d created for myself.
Well, I found out it wasn’t as easy as all that, or so I thought… The first bit of help I discovered was at the Affiliate Marketing Journal, and he had the right idea about turning OFF the rewrite engine and then turning it back on (in a fashion)
But perusing the htaccess forums, I came upon the easiet thing in the entire world, it’s one tiny little line and it goes in the ROOT folder’s .htaccess file.
Just AFTER the line, RewriteEngine on
add this little rule,
RewriteRule ^shop/ - [L]
Where shop is the folder that you want the rules in the ROOT folder to NOT affect.
Clear as mudd?
If anyone has ever found and easier way to do this, please comment.