The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
.htaccess error pages
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... Code:
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 |
#2
|
||||
|
||||
Code:
ErrorDocument 400 /index.php ErrorDocument 401 /index.php ErrorDocument 403 /index.php ErrorDocument 404 /index.php ErrorDocument 404 /index.php |
#3
|
|||
|
|||
It works correctly now, but the issue is the paths for images/css are wrong if you go to a page like http://www.gfx-help.com/test1/test2/
I had a replacement variable for image paths which pointed to "images/theme", I changed that to "http://www.gfx-help.com/images/theme" and thought that would fix it, but it didn't help. Perhaps it's happening due to the css paths being incorrect? |
#4
|
||||
|
||||
Add a base element to the top of your headinclude template:
HTML Code:
<base href="http://www.gfx-help.com/" />
|
#5
|
|||
|
|||
Nice, works perfect.
Thanks Dismounted |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|