: Redirect query string URL via .htaccess I am trying to redirect all query strings to a new URL. Search query example www.example.com/?s=cars to resolve to www.example.com/?search_gcse/?q=cars ("cars"
I am trying to redirect all query strings to a new URL.
Search query example example.com/?s=cars to resolve to example.com/?search_gcse/?q=cars ("cars" is just an example).
What is the syntax for the .htaccess rule?
More posts by @Dunderdale272
1 Comments
Sorted by latest first Latest Oldest Best
Partly depends on which question mark you want to keep. You have two question marks in the URL that you're trying to resolve to & that won't work. I'll assume that the last question mark is the one you want to keep
RewriteCond %{QUERY_STRING} (?:&|^)s=(w+)
RewriteRule ^ www.example.com/search_gcse/?q=%1
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.