Jump to content

Custom 404 Error Pages Problems!


holmedwa04

Recommended Posts

Hi AllI Don't know where I should post this so I thought the best section would be general and then it could be moved if needsbe.I have created a custom 404 error message for my website and it works fine, but the only problem is it doesn't work on my new domain.The actual website address is:http://hosting.burrawcentral.org/goathlandand the custom 404 works if you go via that page but...www.goathland.co.ccit doesn't work and I can't for the life of me work out why. I have inklings but I am not sure, if you could help me with this I would be very appreciative. :)

Link to comment
Share on other sites

i checked your second website, it says "Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." which means the server cannot find the 404 error message file where you have specified it. Check the location of the file or write an absolute path to that file.

Link to comment
Share on other sites

Well I know that the path is okay when access via the absolute link, but obviously when it is access via the domain name then the link is going to be different, so what would it be when accessed via domain name and not original URL and can I use two different links in the .htaccess. If you get what I mean?

Link to comment
Share on other sites

This is what is written in the .htaccess document:

ErrorDocument 404 /goathland/404.html
Obviously this works for the proper URL but not for the domain, really appreciate any help you can give, I am sure it is just something really basic that I am missing! :)
Link to comment
Share on other sites

My site is hosted by another site so my URL is their URL plus my folder, that is why I have used /goathland/404.html as the path. But when accessed by the domain name, it doesn't work.EDIT: When the link in the .htaccess is changed to /404.html the 404 works for access via the domain name but not via proper URL and when changed to /goathland/404.html it works for access via proper URL but not domain name. If you get what I mean? :)

Link to comment
Share on other sites

Is there no way of setting up a conditional statement or something, so if accessed via domain use this path and if accessed by proper URL use this path? Because as I understand it the domain is a shortcut of the full URL isn't it?EDIT: I have tried an absolute path to the file and it works but it messes the search feature up by making it display funny things.

Link to comment
Share on other sites

Is there no way of setting up a conditional statement or something, so if accessed via domain use this path and if accessed by proper URL use this path? Because as I understand it the domain is a shortcut of the full URL isn't it?
I'm not sure, that's why I suggested to ask your host, I don't do a lot of work with .htaccess and I'm not sure what it can and can't do. If it can access the HTTP host header then it can tell which host you're on. But if you put 2 copies of the 404.html file in the root and the /goathland directory it should find one no matter which host you're on.
Link to comment
Share on other sites

Yes! :) You have saved the day! :) Well saved me from ripping my hair out! Lol, I called it 404.html and have one in the root, one in the goathland folder and the .htaccess in the goathland folder and it works from both the domain and the URL. :)If the Host ever want to make their own custom error message mine should not interfere with theirs unless they have the same name will they? Because I have only put the .htaccess in my folder?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...