View Full Version : 404 page questions...
blueridg
04-23-2006, 04:31 PM
Hey all. I am using an addon domain on my site and I want to have a custom 404 page in PHP (if possible) display when pages are not found. Is that possible with an addon site or will it always default back to the main sites 404page?
areidmtm
04-23-2006, 05:02 PM
Create a file called ".htaccess" in your addon domain folder. When doing so, just make an empty text file in Notepad or whatever, and make sure you start the filename with a dot — it's vital. This means that it is no longer a text file — the file suffix will be .htaccess, so it doesn't have a filename of its own.
Now you need to point this file to your custom page. Add this line to the .htaccess file (edit it with a text editor like Notepad):
ErrorDocument 404 http://www.example.com/404page.php
Make sure it's all on one line, and change that address to the full address of your newly created page.
And that should do it.
blueridg
04-24-2006, 04:57 AM
Arg! I knew it was something along those lines but I never would've figured it out. Thanks a million!
Just a note for anyone else with this situation, I found out that even though my addon site can be accessed by its own domain name, the address you put for the file needs to be the path from the parent site in order for it to work.
For example: ErrorDocument 404 http://www.addondomain.com/404page.php will not work
but ErrorDocument 404 http://www.parentdomain.com/addondirectory/404page.php does work
areidmtm
04-24-2006, 08:37 AM
but ErrorDocument 404 http://www.parentdomain.com/addondirectory/404page.php does work
Yeah, that does look alot better, huh?
Anyway, I'm glad that I could help!
vegasgwm
04-24-2006, 08:45 AM
I believe ther's another option besides the .htaccess:
copy your error pages from main also to your addon domain directory and modify the 404 page in that addon dir.
areidmtm
04-24-2006, 09:18 AM
I think that will work too, but those pages are regular HTML. Blueridg wanted to have them PHP pages
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.