norbidrak
norbidrak

Reputation: 473

Hiding some URL parameters, but not all (with .htaccess)

I have URL like that

  test/users?p=show

and i made it to be like

test/users/show

by using rule:

 RewriteRule  ^users/(\w+)$      users.php?p=$1 [L]

Parameter p could be different and it contains words as arguments, but i would like to add some additional parameters to it in some situations. When im using

  test/users?p=show&wg=1

it works, but i'd like to work it with

test/users/show&wg=1 or test/users/show?wg=1

How to achieve that effect ??

Is it even possible to add parameters with & to already made rule like that (it could be 1 to 4 additional parameters) ??

Upvotes: 1

Views: 141

Answers (1)

Legionar
Legionar

Reputation: 7607

Simple add QSA:

RewriteRule  ^users/(\w+)$      users.php?p=$1 [QSA,L]

Then it will also pass your parameters into query string.

Upvotes: 2

Related Questions