I'm trying to get friendly URLs on my web site so I don't have to call specific file through URL.
Example:
Index page - http://www.website.com
Go to a users profile page - http://www.website.com/username
Could someone please point me in the right direction to find out how this is done.
Thank you.
You can use Apache rewrite engine module.
.htaccess
Add your rewrite condition in it
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
Options -Indexes </IfModule>
And all your requests to server will be forwarded to index.php
and data from url you can get from Query String
$_GET["url"]
then you can do what ever you want with it.
You're talking about using URL Rewrite. Try: http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/