user1619228
user1619228

Reputation: 63

URL Rewrite using htaccess for one variable

My url is

domain.com/?p=slide&op=1

here i rewrite domain.com/slide using

RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?p=$1

I don't want to rewrite op=1, it should work when i enter

domain.com/slide?op=1

Any help would be appreciated!.

Upvotes: 0

Views: 78

Answers (1)

Corbin
Corbin

Reputation: 33447

Sounds like you're looking for the QSA flag.

RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?p=$1

Will make it so that any query string is kept and appended to the new URL.

Upvotes: 1

Related Questions