From development to testing to production our website resides in three different environments
- http: //localhost/version/
- http: //www.production.com/test/
- http: //www.production.com/
(see examples of URLs in the following .htaccess snippet)
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^brand/(.+) /products.php?brand=$1 [R,NC]
RewriteRule ^product/(.+) /products.php?model=$1 [R,NC]
How do I capture that first part of the URL and prepend it in the .htaccess file, so that the following URLs all behave the same:
- http: //localhost/version/product/c20
- http: //www.production.com/test/product/c20
- http: //www.production.com/product/c20
I've looked at RewriteCond, but haven't found out how I can use it in this case. Enlighten me, please.