Kitty Posted December 25, 2006 Share Posted December 25, 2006 I don't really know what it's called, but I see it alot on other sites. How do I get rid of the .php extension? Like if I have a page mysite.com/page.php it would be mysite.com/page/Thanks! Quote Link to comment Share on other sites More sharing options...
fert Posted December 25, 2006 Share Posted December 25, 2006 you create a directory and put only page.php in it or you could use .htaccess Quote Link to comment Share on other sites More sharing options...
Kitty Posted December 25, 2006 Author Share Posted December 25, 2006 Thanks, I didn't think about folders. How would I do it using .htaccess? Quote Link to comment Share on other sites More sharing options...
tomfmason Posted December 25, 2006 Share Posted December 25, 2006 Assuming that you are using apache as the webserver, use mod_rewrite.Here is a simple example that should do exactly what you asked for. This will process domain.com/foo/ as domain.com/foo.php[code]RewriteEngine onRewriterule ^foo/ foo.php [L][/code]Now say you wanted to process all requests to domain.com/foo/request/ as /reguest.php you would do this..[code]RewriteEngine onRewriterule ^foo/(.+)\/ $1.php [L][/code]Hope that helps,Tom Quote Link to comment Share on other sites More sharing options...
Kitty Posted December 25, 2006 Author Share Posted December 25, 2006 Thank you, should I write all pages like that?EDIT//It didn't work.. Quote Link to comment 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.