Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-14-2007, 12:22 PM   #1
Myst
Confirmed User
 
Join Date: Feb 2004
Location: Alberta, Canada
Posts: 4,707
How do you redirect all 404 requests to a specific page, regardless of the subdomain?

Anyone know how to do this?

Basically all 404 requests to *.domain.com/* goes to domain.com/404.html
__________________
ICQ: 298-523-037
Myst is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-14-2007, 12:46 PM   #2
Myst
Confirmed User
 
Join Date: Feb 2004
Location: Alberta, Canada
Posts: 4,707
bumpbump
__________________
ICQ: 298-523-037
Myst is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-14-2007, 01:09 PM   #3
chris01282
Confirmed User
 
chris01282's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 370
RewriteEngine On
ErrorDocument 400 http://www.domain.com/404.html
ErrorDocument 401 http://www.domain.com/404.html
ErrorDocument 403 http://www.domain.com/404.html
ErrorDocument 404 http://www.domain.com/404.html
ErrorDocument 500 http://www.domain.com/404.html
ErrorDocument 501 http://www.domain.com/404.html
ErrorDocument 503 http://www.domain.com/404.html


copy this to a text file in the root of all domains/sub domains that you want to redirect 404 traffic from and rename it to .htaccess

or do the same and just use the "ErrorDocument 404" line from above

that should do it, or someone here will correct me
chris01282 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-14-2007, 01:23 PM   #4
EBORG9
Confirmed User
 
Join Date: Oct 2006
Location: Sin City
Posts: 1,823
I have this in my .htacess file:
_____________________________________
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond &#37;{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
__________________________________
Where exactly would you put this, to make it function properly, before, or after?
EBORG9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-14-2007, 01:57 PM   #5
Myst
Confirmed User
 
Join Date: Feb 2004
Location: Alberta, Canada
Posts: 4,707
Quote:
Originally Posted by chris01282 View Post
RewriteEngine On
ErrorDocument 400 http://www.domain.com/404.html
ErrorDocument 401 http://www.domain.com/404.html
ErrorDocument 403 http://www.domain.com/404.html
ErrorDocument 404 http://www.domain.com/404.html
ErrorDocument 500 http://www.domain.com/404.html
ErrorDocument 501 http://www.domain.com/404.html
ErrorDocument 503 http://www.domain.com/404.html


copy this to a text file in the root of all domains/sub domains that you want to redirect 404 traffic from and rename it to .htaccess

or do the same and just use the "ErrorDocument 404" line from above

that should do it, or someone here will correct me
I tried it but it wont redirect all subdomains too..
domain.com/* -> 404.html works
*.domain.com/ -> doesnt
__________________
ICQ: 298-523-037
Myst is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-14-2007, 01:58 PM   #6
borked
Totally Borked
 
borked's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 6,284
Quote:
Originally Posted by EBORG9 View Post
I have this in my .htacess file:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On

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

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
__________________

For coding work - hit me up on andy // borkedcoder // com
(consider figuring out the email as test #1)



All models are wrong, but some are useful. George E.P. Box. p202
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-14-2007, 02:02 PM   #7
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
you need to setup wildcard subdomains
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-14-2007, 02:04 PM   #8
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
depending on your hoist its prob not setup that way by default so you will likely need to ask your host to setup wildcard subs
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-14-2007, 02:10 PM   #9
EBORG9
Confirmed User
 
Join Date: Oct 2006
Location: Sin City
Posts: 1,823
Quote:
Originally Posted by borked View Post
Code:
<IfModule mod_rewrite.c>
RewriteEngine On

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

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Excellent. Thanks.
EBORG9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-14-2007, 02:11 PM   #10
ssp
Confirmed User
 
Join Date: Jan 2005
Location: United Kingdom
Posts: 7,990
I don't think the mod rewrite solution is the correct solution as it parses the headers as 200 instead of 404. This might look ok the the surfer but is technically incorrect and search engines won't like it much.

Correct me if I'm wrong.
ssp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.