tags:

views:

17

answers:

1

I want the following url

http://www.mydomain.com/user.php?id=username

to

http://www.mydomain.com/username

via .htaccess...

i also want to avoid subdirectory name conflict.... where i have a rewrite rule i.e

RewriteRule ^home/$ home.php?id=$1 [NC,L]

so my url become http://www.mydomain.com/home/ so i want this home to be ignored...in http://www.mydomain.com/username

+1  A: 

Rewrite rules are evaluated in the order they appear. So just put your home rewrite rule first, and your username rewrite rule second, like this:

RewriteRule ^home/(.*)$ home.php?id=$1 [NC,L]

RewriteCond %{QUERY_STRING} ^id=(.*)$
RewriteRule ^user.php$ $1 [NC,L]
Ben Lee