gfxhelp.com
09-18-2008, 03:59 AM
I want to make it so if someone types in a bad url it takes them back to my homepage. Currently the problem I'm having is if someone goes to:
http://www.gfx-help.com/blah123.html
or
http://www.gfx-help.com/blah123
it loads the error page which has the same code as the index.php. I would rather have it redirect back to index.php, but this still works. The problem is if someone goes to:
http://www.gfx-help.com/blah123/blah456/ all of the images and links don't work since most of them are not hard linked.
Does anyone have any idea how to do this? I basically just want any non-existent page to redirect back to my home page. I was thinking of just putting a meta redirect in each of the error pages, but perhaps there's a better way to do this?
My .htaccess currently looks like this...ErrorDocument 400 /400.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 404 /500.php
RewriteEngine on
RewriteCond %{HTTP_HOST} ^gfx-help.com$
RewriteRule ^/?$ "http\:\/\/www\.GFX\-Help\.com" [R=301,L]
RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{HTTP_HOST} ^gfx-help.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.gfx-help.com$
RewriteRule ^index.php$ "http\:\/\/www\.gfx\-help\.com\/" [R=301,L]
Options All -Indexes
http://www.gfx-help.com/blah123.html
or
http://www.gfx-help.com/blah123
it loads the error page which has the same code as the index.php. I would rather have it redirect back to index.php, but this still works. The problem is if someone goes to:
http://www.gfx-help.com/blah123/blah456/ all of the images and links don't work since most of them are not hard linked.
Does anyone have any idea how to do this? I basically just want any non-existent page to redirect back to my home page. I was thinking of just putting a meta redirect in each of the error pages, but perhaps there's a better way to do this?
My .htaccess currently looks like this...ErrorDocument 400 /400.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 404 /500.php
RewriteEngine on
RewriteCond %{HTTP_HOST} ^gfx-help.com$
RewriteRule ^/?$ "http\:\/\/www\.GFX\-Help\.com" [R=301,L]
RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{HTTP_HOST} ^gfx-help.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.gfx-help.com$
RewriteRule ^index.php$ "http\:\/\/www\.gfx\-help\.com\/" [R=301,L]
Options All -Indexes