View Single Post
Old 02-14-2009, 01:40 PM   #2 (permalink)
Scottymeuk
The Contributor
 
Join Date: Jan 2009
Posts: 40
Thanks: 10
Scottymeuk is on a distinguished road
Default

Its called mod_rewrite. You use a .htaccess file to rewrite the url. For example:

The raw php URL will look like:

Code:
http://example.com/?user=Scottymeuk
But with the following mod_rewrite code in a .htaccess file (In the root):

Code:
RewriteEngine on
RewriteRule user/(.*)/$ /?user=$2

It will turn out like:

Code:
http://example.com/user/Scottymeuk
So overall, they are not real directories, they are actually getting the information from the database using php but its being rewrote using a .htaccess file.

Please note: I have not tested this code.
Scottymeuk is offline  
Reply With Quote
The Following User Says Thank You to Scottymeuk For This Useful Post:
hello-world (02-14-2009)