My own 404 error page ?

Status
Not open for further replies.

blackheart99999

New Member
Messages
96
Reaction score
0
Points
0
How can I set up my own error page ?
I have created a default page which I want to display in case of 404 error.

There are some tags: referring url, visitor's ip address etc. I don't get it...

So, could you please tell me what to do to get the desired page in case of error ?

Thank you in advance.
 

blackheart99999

New Member
Messages
96
Reaction score
0
Points
0
Thats what I'm saying, I don't get the tags to put in for a particular error !
What should I select ?
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
Those are just shortcuts, you don't need them. For example if you wanted to put the users' IP address on the page, you would click the "Visitor's IP address" tag button and it would insert a code so that when the page loads, the user's IP address show up in that spot on the page.
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
The file names itself error codes. So just place the error messages.. Generally occurring one is 404 so place that page not found error in your way.

You can write general html code in that file.
 

blackheart99999

New Member
Messages
96
Reaction score
0
Points
0
Ok. I get it....
But the question is still there...
How to display my own page in case of error ?:hahano:
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
your own page of 404 error or you want redirection to other page incase of error.

If you want your own 404 then code it in the same page or Redirect to other page
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
You want to redirect your errors to a different page, rather than using the CPanel generated page?

You can do this using .htaccess http://www.javascriptkit.com/howto/htaccess2.shtml

Or by using meta tag redirects and the CPanel tool you are currently using http://webmaster.iu.edu/tool_guide_info/refresh_metatag.shtml (use a value of 0 for the refresh time then the user won't see another page)

I say .htaccess is the way to do it, if you feel comfortable. Create/edit the one in your public_html folder or the folder your site is located in.
 
Last edited:

blackheart99999

New Member
Messages
96
Reaction score
0
Points
0
Alright !
I think I got it this time...

Well... No.
I really got it this time !!
Thank you.
 
Last edited:

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
Just public_html

.htaccess affects everything in the same folder and any folder underneath it, so if you create new sub folders, make sure you make new .htaccess files to adjust for the changes you've made!

for example, you create an addon domain called testdomain.com located at public_html/testdomain. If you put your .htaccess in public_html that has error page currentdomain/error.php testdomain's error page will be currentdomain/error.php! It's like .htaccess copies itself in every folder and adds to whatever .htaccess is there unless you specifically give it something else.

Kind of an advanced scenario, but it's good to be aware :D
 
Last edited:
Status
Not open for further replies.
Top