I've created a very basic php templating system that I'm using to display a page with this URL: /basedir/index.php?page=home The home content is served by the script home.php. With a rewrite rule in .htaccess, I want my url to look like this: /basedir/home. The problem that I'm having is that I've got stuck when it comes to rewrite one more GET variable that I'm using to display a user's profile. For now the profile page url looks like this: /basedir/profile?user=username. Now I want it to look like this: /basedir/profile/username. So far, my .htaccess looks like this: RewriteEngine On RewriteBase /basedir/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) RewriteRule ^([^?]*) ?page=\$1 [L,QSA]  I have no idea if this is good or if i have to write a completely new .htaccess file.