SkyNT
SkyNT

Reputation: 803

rewriterule mixed regular query and clean URL?

I am trying to get a regular query appended to any clean URL to be parsed properly. I've spent the last 3 hours trying to attempt this to no avail.

/aa/bb/?f=ff
/aa/bb/cc/dd/ee/?f=ff&g=gg

should become

a=aa&b=bb&f=ff
a=aa&b=bb&c=cc&d=dd&e=ee&f=ff&g=gg

instead I get

a=aa&b=bb
a=aa&b=bb&c=cc&d=dd&e=ee

This is my htaccess line:

RewriteRule ^([a-z]+)/([a-z]+)/?([a-z0-9]+)?/?([a-z0-9]+)?/?([a-z]+)?/?\??(.*)?$ index.php?a=$1&b=$2&c=$3&d=$4&e=$5&$6 [NC,L]

If you are wondering why I want to do this, it is to accommodate some libraries which do not support clean URLs very well.

Upvotes: 1

Views: 154

Answers (1)

Phil
Phil

Reputation: 164952

Use the QSA flag, eg

RewriteRule ^...$ foo.php [NC,L,QSA]

Upvotes: 1

Related Questions