![]() |
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 |
bumpbump
|
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 :thumbsup |
I have this in my .htacess file:
_____________________________________ # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{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? |
Quote:
domain.com/* -> 404.html works *.domain.com/ -> doesnt :) |
Quote:
Code:
<IfModule mod_rewrite.c> |
you need to setup wildcard subdomains
|
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
|
Quote:
|
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. |
All times are GMT -7. The time now is 08:12 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123