Apache Tinkkering..

Not anything major, but I wanted to figure out how to make my apache server re-write the URL of my site if someone came to http://fratm.com I wanted the server to dump them on http://www.fratm.com so basically how to do a all encompassing redirect from fratm.com to www.fratm.com It was quite easy actually, by using ReWriteRules.

In an htaccess file I just added this code.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^fratm\.com* [NC]
RewriteRule ^(.*)$ http://www.fratm.com/$1 [redirect]

It works, but broke my blogging software, mainly because I had some re-write rules in the apache config already and this little but of code was causing them to break, so adding this code minus the "RewriteEngine On" part to my apache config fixes the problem.

-Steve

Powered by Drupal - Design by artinet