View Single Post
Old 02-01-2006, 09:55 PM  
mikeyddddd
Viva la vulva!
 
mikeyddddd's Avatar
 
Join Date: Mar 2003
Location: you can't please everyone, so you got to please yourself
Posts: 16,557
Would something like this work?

ErrorDocument 404 http://domain.com/404.html

RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
Rewriterule (.*) http://www.domain.com/$1 [R=404]

404 goes to your page without www

Rewrite adds the www and returns 404. Also catches any referrals without www.


Or this just goes to root:

ErrorDocument 404 http://domain.com/

RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
Rewriterule (.*) http://www.domain.com/ [R=404]


or 404 page:

ErrorDocument 404 http://domain.com/

RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
Rewriterule (.*) http://www.domain.com/404.html [R=404]
mikeyddddd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote