View Single Post
Old 11-15-2009, 08:50 PM  
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
.Htaccess/Mod_Rewrite ninjas inside plz.

Ok, I am doing a simple domain.com to www.domain.com redirect, and it works fine, but if you go to domain.com/somepage.html it redirects to www.domain.com/ instead of www.domain.com/somepage.html.

Anyone know why? And how to fix it?

Code:
<IfModule mod_rewrite.c>

  RewriteEngine On

  Options +FollowSymLinks
  Options +Indexes

  ErrorDocument 404 /

  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . / [L]

  RewriteCond %{HTTP_HOST} ^([^.]+\.(com|net|org)) [NC]
  RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]

</IfModule>
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote