Jacbey Posted January 4, 2012 Share Posted January 4, 2012 Hi, My question is actually not so much to do with php but anyway. I want to make a 404 page that doesn't redirect. So say for example, I go to www.mysite.com/eurgire and this was invalid it wouldn't go to www.mysite.com/404.html it would stay as www.mysite.com/eurgire but display a 404 message. How would I go about doing this? Thanks in advance, Jacob. Quote Link to comment https://forums.phpfreaks.com/topic/254311-404-page-help/ Share on other sites More sharing options...
ecabrera Posted January 4, 2012 Share Posted January 4, 2012 #404 ErrorDocument 404 /notfound.php you can replace the notfound.php will anything you want Quote Link to comment https://forums.phpfreaks.com/topic/254311-404-page-help/#findComment-1303976 Share on other sites More sharing options...
Jacbey Posted January 4, 2012 Author Share Posted January 4, 2012 I know that. But that redirects www.mysite.com/incorrect.html to mysite.com/404.html which I don't want it to do. Quote Link to comment https://forums.phpfreaks.com/topic/254311-404-page-help/#findComment-1303979 Share on other sites More sharing options...
ecabrera Posted January 4, 2012 Share Posted January 4, 2012 while for me anytime a user types in a wrong link for explame they type in google.com/web it would just stay there and should the error Quote Link to comment https://forums.phpfreaks.com/topic/254311-404-page-help/#findComment-1303981 Share on other sites More sharing options...
scootstah Posted January 4, 2012 Share Posted January 4, 2012 while for me anytime a user types in a wrong link for explame they type in google.com/web it would just stay there and should the error That isn't the default Apache behavior. This is usually done by routing everything through the index.php file. By doing this, pages are never technically "not found", since the index.php file exists. Therefore you can have the functionality you are looking for and force 404 headers when something is "not found". Quote Link to comment https://forums.phpfreaks.com/topic/254311-404-page-help/#findComment-1303989 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.