I’m just going to post this up here because this is something I do all the time and for some reason it will never stick in my head. The idea is that I have a server root that I want to forward to another URL with mod_rewrite. Yeah, I know, I could just write it in mod_alias or a quick meta tag or JavaScript or whatever, but I live the clean mod_rewrite solution that I can bake right into a httpd.conf or .htaccess file. So here is it, whenever you want to forward something like: http:///www.mywebsite.com to http://www.mywebsite.com/pls/portal here it is:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/$ [NC]
RewriteRule ^.*$ http://www.mywebsite.com/pls/portal [R,L]
OK, enough, done…night.
PS- As you can tell I’m a bit frustrated with myself over this one. It’s only about the 100th time I’ve done something like this and I can never remember the syntax.