GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   mod_rewrite question (https://gfy.com/showthread.php?t=571055)

Mr Pheer 02-01-2006 05:46 PM

mod_rewrite question
 
Is there anyway to direct the wildcards to my 404 so it sends the 404 header?

for instance.. blah.domain.com or just domain.com hit 404

so if say... google spider requests a wildcard, or just domain.com, or a page that doesnt exist, it gets the 404 page?

V_RocKs 02-01-2006 07:03 PM

You would rather allow Google to spyder and give you the traffic based on the domain... Unless it is only going to be getting duplicate content. If it isn't going to be getting duplicate content then you would allow it to come in...

V_RocKs 02-01-2006 07:04 PM

If it was going to be duplicate content then you would want to help yourself out SE wise and do a 301 so the SE's will give you credit.

Mr Pheer 02-01-2006 08:16 PM

i dont want to do anything except what I asked about... does anyone know how to do it?

mikeyddddd 02-01-2006 09:55 PM

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]

Mr Pheer 02-01-2006 10:14 PM

thanks mikey

I'll give those a try :)


All times are GMT -7. The time now is 08:55 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123