mitch_h
01-17-2011, 09:52 AM
This is the code I have in my .htaccess.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^ - [L]
RewriteRule ^([^/]+),([^/]+)$ index.php?id=$1&mode=$2 [NC,L]
The last line is the important one for the problem I am having. It means I can have a url:
www.domain.com/home,all
which is the same as:
www.domain.com/?id=home&mode=all
It works great when the url has ".com/something,something" even ".com/home,s" or "home,1". The problem occurs when I just have ".com/home" or ".com/home,".
Does anyone know how I can have it work with either id=$1 alone or with &mode=$2.
Thanks.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^ - [L]
RewriteRule ^([^/]+),([^/]+)$ index.php?id=$1&mode=$2 [NC,L]
The last line is the important one for the problem I am having. It means I can have a url:
www.domain.com/home,all
which is the same as:
www.domain.com/?id=home&mode=all
It works great when the url has ".com/something,something" even ".com/home,s" or "home,1". The problem occurs when I just have ".com/home" or ".com/home,".
Does anyone know how I can have it work with either id=$1 alone or with &mode=$2.
Thanks.