hey all,
im using an .htaccess file on my server to do url redirection. basically im hiding php server variables from the user w/ a mod_rewite trick. the code i have "works" but not quite the way i want it...
Code:
RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ info.php?x=$1&y=$2&z=$3
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ info.php?x=$1&y=$2&z=$3
so, if you enter this url:
http://www.mysite.com/xero/owns/us
that will display the content from
http://www.mysite.com/info.php?x=xero&y=owns&x=us
which is want i want it to do.
but, i want those 3 variables to be OPTIONAL!
so, if your typed in just /xero/owns it would do mysite.com/info.php?x=xero&y=owns&z= (null)
can any one point me in the right direction?
thanx!
-----------------[EDIT]------------------
i should have posted this in the apache forum.
also, i found the answer on
this sticky
sorry!