views:

83

answers:

2

How would I go about making my site use organic urls (like http://www.mysite.com/aboutus) - i don't want to use a CMS - my site is powered from index.php is there anyway of getting the text after the / so that I can select that page from the database? I'd rather not do /?aboutus

Thank you :D

+1  A: 

You have to use a URL Rewrite engine.

Apache HTTP Server provides URL rewriting through the mod_rewrite module. You may want to check out these articles to get started:

Daniel Vassallo
+1  A: 

You can use mod_rewrite as others suggested. For example the following will map http://my.site.com/page to http://my.site.com/index.php?module=page

RewriteEngine on
RewriteRule ^/([a-z0-9]+)/?$ /index.php?module=$1 [L,QSA]

If you would like to use RESTful URLs throughout your site, here is a handy reference from microformats.org: rest/urls

Ozgur Ozcitak