codrgi Posted April 17, 2009 Share Posted April 17, 2009 how do i redirect to www.website.com/home if someone tried to go to my home.php file? EXAMPLE URL- www.website.com/home HOW TO REDIRECT THIS TO THE ABOVE EXAMPLE URL? www.website.com/home.php Right now i'm using Apache, and just want to redirect it to the first url if someone tries adding the .php to the file, how can this be done? Quote Link to comment https://forums.phpfreaks.com/topic/154522-how-to-do-this/ Share on other sites More sharing options...
ober Posted April 17, 2009 Share Posted April 17, 2009 mod_rewrite (Apache .htaccess change) will get you what you want. If there is only one example where you need to this and "home.php" doesn't exist, you could always create a custom 404 page. Quote Link to comment https://forums.phpfreaks.com/topic/154522-how-to-do-this/#findComment-812436 Share on other sites More sharing options...
codrgi Posted April 17, 2009 Author Share Posted April 17, 2009 Does anyone have any examples of how i could do this? Quote Link to comment https://forums.phpfreaks.com/topic/154522-how-to-do-this/#findComment-812556 Share on other sites More sharing options...
The Little Guy Posted April 17, 2009 Share Posted April 17, 2009 http://wiki.dreamhost.com/Htaccess_tricks#No_File_Extension Quote Link to comment https://forums.phpfreaks.com/topic/154522-how-to-do-this/#findComment-812624 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.