Jump to content

Remove .php


Zie

Recommended Posts

How do websites remove the file extensions on their pages? In example, how google uses something like this: http://www.google.com/webhp?tab=mwI've been looking around the web for awhile, and couldn't find much relevant information, and the information that was relevant, didn't work. I'm sure this isn't the right forum, but I couldn't find a forum that seemed like it should go there.

Link to comment
Share on other sites

Hmm, for that I think you'd have to change the configuration of the server to execute PHP in files that don't have an extension.

Link to comment
Share on other sites

You can use Apache's mod_rewrite to append the .php onto URLs that don't have it (when requested from your server).

RewriteRule ^(.*?)\?(.*?)$ $1.php?$2

Link to comment
Share on other sites

Google does not use PHP. Most sites that use PHP (e.g. wikipedia, mysql.com, etc.) will have the .php extension on its pages.

Link to comment
Share on other sites

Wikipedia uses PHP, but they also use mod_rewrite to hide the extension. In fact, their RewriteRule is fairly complex, with paths converted into querystrings.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...