KirstyScott Posted January 7, 2009 Share Posted January 7, 2009 does anyone know how i re-direct a user to my /index.php if they try and navigate to a .php file that dosen't exist? apart from saying the 404 error of 'Object not found'? Link to comment https://forums.phpfreaks.com/topic/139911-re-directing-a-user/ Share on other sites More sharing options...
envexlabs Posted January 7, 2009 Share Posted January 7, 2009 You can create a custom 404 page and use .htaccess to point to that file. http://www.pageresource.com/zine/custom404.htm Link to comment https://forums.phpfreaks.com/topic/139911-re-directing-a-user/#findComment-731978 Share on other sites More sharing options...
chronister Posted January 8, 2009 Share Posted January 8, 2009 If you wish to redirect to your index page, then you would add this to your .htaccess file. The .htaccess file should live in the root of the site. If it does not exist, you can create it. make sure you change "yoursite.com" to your actual domain name. .htaccess ErrorDocument 404 http://www.yoursite.com/index.php Nate Link to comment https://forums.phpfreaks.com/topic/139911-re-directing-a-user/#findComment-732115 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.