ArizonaJohn Posted June 22, 2009 Share Posted June 22, 2009 Hello, I have a page with a URL like "example.com/blogs.php". Is there a way I could direct users to this page if they type in "example.com/blogs"? Thanks in advance, John Link to comment https://forums.phpfreaks.com/topic/163251-making-examplecomblogs-redirect-to-examplecomblogsphp/ Share on other sites More sharing options...
flyhoney Posted June 22, 2009 Share Posted June 22, 2009 If you are on an apache server you can use mod_rewrite. If you have mod_rewrite enabled on your Apache server, you can place a .htaccess file in your webroot and set up a rule that will redirect the url appropriately. http://www.sitepoint.com/article/guide-url-rewriting/ Link to comment https://forums.phpfreaks.com/topic/163251-making-examplecomblogs-redirect-to-examplecomblogsphp/#findComment-861331 Share on other sites More sharing options...
947740 Posted June 22, 2009 Share Posted June 22, 2009 The previous method works, but you can just have your default file in that /blogs directory redirect to blogs.php. If index.php is the default file, just place index.php in that directory: <?php header("Location: blogs.php"); ?> Link to comment https://forums.phpfreaks.com/topic/163251-making-examplecomblogs-redirect-to-examplecomblogsphp/#findComment-861335 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.