N-Bomb(Nerd) Posted September 5, 2009 Share Posted September 5, 2009 When somebody visits my website the domain shows as: http://www.website.com/index.php Is there a way to hide the "index.php" in the url? Link to comment https://forums.phpfreaks.com/topic/173265-mod_rewrite-question/ Share on other sites More sharing options...
wildteen88 Posted September 5, 2009 Share Posted September 5, 2009 Just go to http://www.website.com/ instead. Link to comment https://forums.phpfreaks.com/topic/173265-mod_rewrite-question/#findComment-913311 Share on other sites More sharing options...
bundyxc Posted September 5, 2009 Share Posted September 5, 2009 Hehehe, I doubt that was what he was what wildteen88 was talking about. I'm assuming he's trying to ask if he can actually hide the filename from the user, not for his personal browsing. Link to comment https://forums.phpfreaks.com/topic/173265-mod_rewrite-question/#findComment-913314 Share on other sites More sharing options...
corbin Posted September 5, 2009 Share Posted September 5, 2009 As far as mod_rewrite goes, this is about as simple as it gets.... RewriteRule ^index\.php / [R=301] Or: Redirect permanent /index.php / Link to comment https://forums.phpfreaks.com/topic/173265-mod_rewrite-question/#findComment-913343 Share on other sites More sharing options...
synapp2 Posted September 6, 2009 Share Posted September 6, 2009 Use the index.php page only to re-direct to the page you would like to show. One way to do it would be to have your index.php generate a JavaScript statement: window.location="the page you want to display"; Don't put any real content into an index page. Link to comment https://forums.phpfreaks.com/topic/173265-mod_rewrite-question/#findComment-913582 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.