Link to home
Start Free TrialLog in
Avatar of gijew
gijew

asked on

Mod rewrite conditional

Hi,

I'm trying out some stuff with mod rewrite and only have partial success.  I'll give you the problem and show you what I've got and hopefully we can all figure out how to make this work for me = )

I have the site site.com?Site=dynamic_name
When going to different areas of the page I am using site.com?Site=dynamic_name&Ex=New_Command

What I wanted to do is turn that into site.com/dynamic_name and when the second one is called site.com/dynamic_name/New_Command

Make sense?

RewriteCond   %{REQUEST_FILENAME} !-f
RewriteCond   %{REQUEST_FILENAME} !-d
RewriteRule   ^(.*) subsite.php\?Site=$1 [QSA,L]

That gets me the first one so I try to tweak that out a bit to:
RewriteRule ^(.*)-([A-Za-z_\ -]+)\/ subsite.php\?Site=$1&Ex=$2 [QSA,L]

Now I'm running into problems.  I'm sure it will be obvious to those of you with more skills/knowledge of URL rewriting but that's not me = /

Thank you very much for any help you can assist with this.
ASKER CERTIFIED SOLUTION
Avatar of funamentalist
funamentalist
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial