I have seen some sites where when a page won't load or the file is missing, it will bring you to the 404 message page, but it will be customized for like the site with images that the admin made and it will say like "sorry, please contact blah blah blah if this occurs frequently". Is this JavaScript or can it be done with HTML?Well the page is html or php but the actual redirect is done using htaccess. htaccess only works on apache servers.
<!-- m --><a class="postlink" href="http://www.javascriptkit.com/howto/htaccess2.shtmlThis">http://www.javascriptkit.com/howto/htaccess2.shtmlThis</a><!-- m --> is generally a server setting. I have customized these for both Apache and Windows 2003 Servers. For example, Apache allows custom page settings as well as behaviour based on the browser in its httpd.conf file. If you do not have access to the server, then you can not really control it because what is happening here is that a user enters a page and the server attempts to find and display it, and when it can not, it resorts to whatever its default settings are. So in a nutshell, they are customized 404 pages that the server has been told to show you.
If your website provider allows access via cPanel, then I "think" there are settings in there that you can customize as well for custom response pages.
If there are JavaScript based answers to this, I'm not aware of them.If on Apache, you create or edit a .htaccess file in your root web directory and add the following line:
.htacess
ErrorDocument 404 <!-- m --><a class="postlink" href="http://www.yoursite.com/error404.html">http://www.yoursite.com/error404.html</a><!-- m -->
The error404.html page (or whatever you want to call it) would be your custom page for 404 errors. You can do the same for other HTTP error codes, should you desire to.And who says you can't teach an old dog new tricks! Since Ive almost always had my own servers, I always just did everything by the config. I had never even tried that.The htaccess has to be allowed in the config and I don't think that's the default but most hosting companies allow it, usually in its most restrictive form. That said, almost anything you can put in the config can go in the htaccess.Try this script. (<!-- m --><a class="postlink" href="http://www.sabrewebdesign.com/support/scripts/errorpages.php">http://www.sabrewebdesign.com/support/s ... rpages.php</a><!-- m -->). It works real well and also sends you a notice when the error happens.I am having a similar problem with htaccess. I have found my website linked to other sites. I have created my own htaccess file to deny those website. When it is on the server I get Error 500, Internal Server Error. I want to be able to view my own website, but I want some linked sites not to have any acess?
What can I do?When you say linked do you mean images from your site are linked else where?I have used this template with my htaccess
<!-- m --><a class="postlink" href="http://www.wsabstract.com/howto/htaccess14.shtml">http://www.wsabstract.com/howto/htaccess14.shtml</a><!-- m -->
Block traffic from multiple referrers
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} badsite\.com [NC,OR]
RewriteCond %{HTTP_REFERER} anotherbadsite\.com
RewriteRule .* - [F]
to deny the sites I do not have access. However the htaccess is giving me an Internal Server 500 on my website. The rejected sites have my site on there page.
How can I reject them and still get a good view on my site and accept all others from viewing my site normally?
<!-- m --><a class="postlink" href="http://www.javascriptkit.com/howto/htaccess2.shtmlThis">http://www.javascriptkit.com/howto/htaccess2.shtmlThis</a><!-- m --> is generally a server setting. I have customized these for both Apache and Windows 2003 Servers. For example, Apache allows custom page settings as well as behaviour based on the browser in its httpd.conf file. If you do not have access to the server, then you can not really control it because what is happening here is that a user enters a page and the server attempts to find and display it, and when it can not, it resorts to whatever its default settings are. So in a nutshell, they are customized 404 pages that the server has been told to show you.
If your website provider allows access via cPanel, then I "think" there are settings in there that you can customize as well for custom response pages.
If there are JavaScript based answers to this, I'm not aware of them.If on Apache, you create or edit a .htaccess file in your root web directory and add the following line:
.htacess
ErrorDocument 404 <!-- m --><a class="postlink" href="http://www.yoursite.com/error404.html">http://www.yoursite.com/error404.html</a><!-- m -->
The error404.html page (or whatever you want to call it) would be your custom page for 404 errors. You can do the same for other HTTP error codes, should you desire to.And who says you can't teach an old dog new tricks! Since Ive almost always had my own servers, I always just did everything by the config. I had never even tried that.The htaccess has to be allowed in the config and I don't think that's the default but most hosting companies allow it, usually in its most restrictive form. That said, almost anything you can put in the config can go in the htaccess.Try this script. (<!-- m --><a class="postlink" href="http://www.sabrewebdesign.com/support/scripts/errorpages.php">http://www.sabrewebdesign.com/support/s ... rpages.php</a><!-- m -->). It works real well and also sends you a notice when the error happens.I am having a similar problem with htaccess. I have found my website linked to other sites. I have created my own htaccess file to deny those website. When it is on the server I get Error 500, Internal Server Error. I want to be able to view my own website, but I want some linked sites not to have any acess?
What can I do?When you say linked do you mean images from your site are linked else where?I have used this template with my htaccess
<!-- m --><a class="postlink" href="http://www.wsabstract.com/howto/htaccess14.shtml">http://www.wsabstract.com/howto/htaccess14.shtml</a><!-- m -->
Block traffic from multiple referrers
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} badsite\.com [NC,OR]
RewriteCond %{HTTP_REFERER} anotherbadsite\.com
RewriteRule .* - [F]
to deny the sites I do not have access. However the htaccess is giving me an Internal Server 500 on my website. The rejected sites have my site on there page.
How can I reject them and still get a good view on my site and accept all others from viewing my site normally?