Sukhchain Singh
Sukhchain Singh

Reputation: 844

htaccess rewrite url with same get parameters

I want to rewrite the url using .htaccess

Here is my main url which will be accessed by public:
http://example.com/watch?v=123456789

I want same values of get parameters but in new location:
http://example.com/index.php?v=123456789

How can i do this? Help will be appreciated! Thanks.

Upvotes: 2

Views: 56

Answers (1)

nachodd
nachodd

Reputation: 723

it could be something like.. (.htaccess at root level)

RewriteRule ^watch/?$ index.php [QSA,L]

The important thing is the QSA option ("QueryString Append")

Hope it helps!

Upvotes: 3

Related Questions