I would like to rewrite http://www.domain.com/{dynamic1}?q={dynamic2} as http://www.domain.com/{dynamic1}/{dynamic2} So all that's needed is replacement of ?q= as / but I just can't work out how to make it work...
Have you tried (added .php): RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ $1.php?q=$2 Code (markup):
Ah, I have noticed a slight bug though. In cases where $2 contains an underscore, it no longer works. Any ideas?
Add _ to the parameters. RewriteRule ^([A-Za-z0-9-_]+)/([A-Za-z0-9-_]+)/?$ $1.php?q=$2 Code (markup): Similarly, To allow any characters: RewriteRule ^(.*)/(.*)/?$ $1.php?q=$2 Code (markup):