66 posts
    Has been part of the Envato Community for over 2 years Has collected 1+ items on Envato Market
jozevodinar says

I would like to make that if the file/directory/ doesn’t exist it would take the visitor to www.mysite.com/error404.php How can i make this? Thanks for the help ;p

632 posts
    Has been part of the Envato Community for over 4 years Has sold $100+ on Envato Market Has collected 10+ items on Envato Market Sells items exclusively on Envato Market
Thecodingdude says
66 posts
    Has been part of the Envato Community for over 2 years Has collected 1+ items on Envato Market
jozevodinar says

Don’t understand this :(

I need so if they enter www.mysite.com/djsuifojdsf.php www.mysite.com/djsuifojdsf123434.php or any file/page that doesn’t exist on my hosting, that it would redirect to www.mysite.com/error404.php

767 posts
    Has been part of the Envato Community for over 5 years Has sold $1,000+ on Envato Market Has collected 50+ items on Envato Market Sells items exclusively on Envato Market
+2 more
outandouter says
66 posts
    Has been part of the Envato Community for over 2 years Has collected 1+ items on Envato Market
jozevodinar says

A .htaccess file is your answer. http://www.htaccessbasics.com/404-custom-error-page/ http://net.tutsplus.com/articles/news/htaccess-files-for-the-rest-of-us/
Ah thank you. Problem is i already once made .htaccess file and it is hidden on cPanel… How could i edit it, or how can i make another, since it will not let me make 2 with same name…?
973 posts
    Has referred 10+ members Has sold $5,000+ on Envato Market Has been a beta tester for an Envato feature Has collected 100+ items on Envato Market
+5 more
aaranmcguire says


A .htaccess file is your answer. http://www.htaccessbasics.com/404-custom-error-page/ http://net.tutsplus.com/articles/news/htaccess-files-for-the-rest-of-us/
Ah thank you. Problem is i already once made .htaccess file and it is hidden on cPanel… How could i edit it, or how can i make another, since it will not let me make 2 with same name…?

\\

\\

145 posts
    Has collected 1+ items on Envato Market Has been part of the Envato Community for over 2 years Sells items exclusively on Envato Market Located in Romania
PixFee says

After you find the .htaccess file add this into it:

ErrorDocument 404 "/404.html"

”/404.html” is the location of your custom error page.
by
by
by
by
by
by