Apache Mod-Rewrite, I have a problem not a error as such but the following makes both $1 and $2 equal to $1 i.e ‘survey’
RewriteRule ^((survey|quiz|form|widget))/create$ items/create/?type=$1 [L]
RewriteRule ^((survey|quiz|form|widget))/([0-9]+)/edit$ items/edit/?type=$1&id=$2 [L]
RewriteRule ^((survey|quiz|form|widget))/([0-9]+)/delete$ items/delete/?type=$1&id=$2 [L]
RewriteRule ^((survey|quiz|form|widget))/([0-9]+)/results$ items/results/?type=$1&id=$2 [L]
RewriteRule ^((survey|quiz|form|widget))/([0-9]+)/reliability$ items/reliability/?type=$1&id=$2 [L]
RewriteRule ^((survey|quiz|form|widget))/([0-9]+)/publish$ items/publish/?type=$1&id=$2 [L]
So it is like
/widget/45657/publish
will go to
/items/publish/?type=widget&id=widget
Instead of
/items/publish/?type=widget&id=45657
Thanks in advance.
Why two parenthesis? This explain your problem.
Try this:
By the way you could optimize your rules with something close to:
Ain’t that shorter?
;)