I've managed to make this work just with a domain by doing the following:
- Code: Select all
rewriteRule ^boston/(.*)$ $1?%{QUERY_STRING}&NID=5 [L]
So in this case, if you go to our http://www.domain.com/boston/file.php
This would be the same as going to http://www.domain.com/file.php, but with the hidden variable NID automatically passed through and set to 5.
What I am now trying to do is to find a way to interpret custom domains. So using the above, assume I had the following:
http://www.bostoncity.com/
http://www.houstoncity.com/
http://www.abcdcity.com/
Each one of those should point to the same location on our server (www.domain.com using my first example), only I need each one of them to pass that same NID variable through as a hidden variable.
Ultimately as the user browses the site, they will remain on one of these URLs, only I'll know what one specifically based on the NID variable.
Any thoughts would be greatly appreciated!
I guess the short is that I need, say 100 domain names to point to the same directory on my server (which is easy to do), only I need the local .htaccess file to read the domain name and pass a variable with it.