Dmaze
Dmaze

Reputation: 37

url rewriting using .htaccess - role of ? in target

Hi Can someone explain what this rule will exactly do. I want to know what is the role of ? towards the end.

RewriteRule ^(products/someproduct.html)$ https://www.myserver.com/? [R=301,L]

looking forward for a quick explanation on the last character ?

Upvotes: 0

Views: 46

Answers (1)

Amine Hajyoussef
Amine Hajyoussef

Reputation: 4430

This prevent appending the query string to the new URL.

for example, a request for https://www.myserver.com/products/someproduct.html?qu=1&bu=2:

with ? : get redirected to https://www.myserver.com/
without ? : get redirected to https://www.myserver.com/?qu=1&bu=2

Upvotes: 2

Related Questions