Click to See Complete Forum and Search --> : htacess with optional multiple expressions


CrazyGaz
02-20-2009, 09:30 PM
Hi,

I am in the process of writing a blogging system and am having .htaccess troubles. i have the following code:


RewriteEngine on
RewriteRule ^([^/]+)/([^/\.]+)/?$ index.php?uname=$1&pg=$2 [QSA,L]
RewriteRule ^/([^/\.]+)/?$ index.php?pg=$1 [QSA,L]


This works fine if I have a url such as USERNAME/home, but not if I simply have the url /home which would be the default if you are not viewing blogs by a user. I think I am close, but I am not sure the exact syntax of the second rewrite.

If anyone could help with this issue, that would be great.

Regards,
Gaz.