23 votes
Accepted

Should query strings be included or removed from the canonical tag?

Query parameters can be used for many purposes. Some of them don't specify the page content and some of them do. If the query parameter is used to specify the content loaded onto the page, then it ...
Stephen Ostermiller's user avatar
4 votes

Temporarily redirect WordPress url with query string from root directory to new url

I think you have two problems. One, the rewrite are checked in order and you put the more constraining one after the least constraining one (i.e. the redirect with your query string should be first.) ...
Alexis Wilke's user avatar
  • 2,235
4 votes

How to redirect a URL and remove parameters using .htaccess?

To redirect the exact URL as stated you will need to use mod_rewrite (ie. RewriteRule and RewriteCond directives) since only mod_rewrite is able to match the query string part of the URL (ie. ...
MrWhite's user avatar
  • 42.8k
4 votes
Accepted

How to make a graph in Google Data Studio showing specific url parameters that were queried in my site?

Constructing a Data Studio Report with Regex Create a report and click edit next to your data source Select "Add Field" Creating Custom Regex Field In Data Studio escaping is weird. You ...
Mike Ciffone's user avatar
  • 6,360
4 votes

Does query string case affect SEO?

It does not matter, but you must be consistent, as all three examples you showed represent different URLs to be indexed. Some like to stick to lowercase as it reduces the possibility of human error ...
Tony McCreath's user avatar
3 votes

Redirect query string URL via .htaccess

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 ...
username's user avatar
3 votes

Is there a set of well-known tracking parameters besides utm_*?

Part of my RewriteCond used to deduplicate URL for a more efficient caching: utm_(?:source|medium|campaign|term|content)|gclid|fbclid|msclkid|emci|emdi|ceid|sourceid|hootPostID|__s gclid fbclid ...
drzraf's user avatar
  • 131
3 votes

“Resources with a "?" in the URL are not cached by some proxy caching servers”

From http://bizcoder.com/caching-resources-with-query-strings: Steve demonstrates when using a version number in the query string, the Squid proxy cache does not cache the static file at all. He ...
Tim Fountain's user avatar
  • 4,454
3 votes

Does rearranging query parameters result in duplicate content?

With regards to duplicate content, as long as the correct canonical tag is set to match the original page, it should be fine. In saying that, it's definitely not optimal to have duplicate pages with ...
Richard's user avatar
  • 164
3 votes

Does Google care about query string case sensitivity, and also does it care about correctness of casing?

Does Google differentiate them? What is Google's behavior, if it finds both of them on my website for a single page? As Google said, case sensitive URLs might lead to multiple URLs indexed: “By ...
Emirodgar's user avatar
  • 3,817
3 votes

Use query parameters or hashes when implementing referral codes?

I don't think either approach is ideal. The parameter approach is likely the better of the 2 as it does not try and jump to a non-existent anchor point on the page. A more appropriate solution might ...
davidgo's user avatar
  • 7,939
2 votes

Prevent Google from indexing and caching pages with query strings

You can instruct Google how to treat urls with parameters, they have a tool for that in Google Search Console. They are passive parameters if they do not change content on a page. If you categorize ...
Bronwyn V's user avatar
  • 3,423
2 votes

What is adding p, subid, and uid variables to the query string of a site url?

These are all used in tracking URLs. A SubID is a string of alphanumeric characters generated at the end of a redirect URL, which records a user-defined variable. uid is Unique Identifier. Check if ...
Kishwar Mohideen's user avatar
2 votes
Accepted

Should out-of-range pagination query produce a 404?

Ideally a 404 status would be used. However, it is not uncommon for a 200 status in such cases. If the 9th page is the last page, ensure that it doesn't link to page 10. If there are no links ...
Stephen Ostermiller's user avatar
2 votes
Accepted

Consequences of adding more URL query parameters?

Disclaimer: Parts of this answer are summarised from excerpts of this blog by SEJ. Yes, adding or removing query parameters periodically may have some negative consequences on SEO, if not handled ...
Anuvesh's user avatar
  • 1,222
2 votes
Accepted

How to redirect all pages of site A, including those with query strings, to homepage of site B

You should add the "query string discard" or QSD flag to your rewrite rule: RewriteRule ^(.*)$ https://SiteB.tld/ [R=301,QSD,L] From the documentation: When the requested URI contains a query ...
Stephen Ostermiller's user avatar
2 votes

How to exclude URL parameters from Google Analytics reports?

Only ? indicates a query parameter; adding f to the exclusion list would remove ?f=... parts of a URL but won't affect /f/.... You should be able to do this with a filter, though. Add a new filter of ...
Reve's user avatar
  • 2,031
2 votes

Is a URL with querystring SEO friendly?

While search engines can recognise these kinds of URL, I can't see them being considered search engine friendly as anything after the ? would be considered a key or value. Its fairly standard now to ...
davidgo's user avatar
  • 7,939
2 votes

Redirect URL ending in certain `variable=value` query string, to `URL?variable` (i.e., strip `=value`)

Your RewriteCond is incidentally valid but fundamentally wrong. For the URL https://example.com/?amp=1, the characters /? are not part of the %{QUERY_STRING} value, which is amp=1 in fact. I said '...
Éric's user avatar
  • 616
1 vote

Redirect in .htaccess when page numbers are both in a query parameter and in the path

This should do it: RewriteCond %{QUERY_STRING} ^page=[0-9]+$ RewriteRule ^/?(page/[0-9]+)$ /$1? [R=301,L] When the query string has a page number in it like page=34 and the path is also a page ...
Stephen Ostermiller's user avatar
1 vote
Accepted

AdSense not showing ads because links from Facebook add a query parameter

<link rel=”canonical” href=”https://example.com/”>
3rKaN_BRATTE's user avatar
1 vote

Redirecting URL with & without query string?

To answer your questions properly you should paste the code you are using for the redirect first, however I won't do that, check below for what I believe you should do. You don not need to implement ...
Raul Reyes's user avatar
  • 2,476
1 vote

How to handle URL query strings with over 1 million combinations

I would probably use robots.txt as is very simple and straight forward. Now you could find a way to canonicalize all new generated pages (depending on the extend of on-page changes that the tool ...
John Could's user avatar
1 vote

How to handle URL query strings with over 1 million combinations

If i correctly understand your goals: on the one side you want to give your visitors a possibility to share a particular page url, which is created by special query string combination, on the other ...
Evgeniy's user avatar
  • 10.1k
1 vote

Htaccess redirect pages from subfolder to root directory while preserving any query string

RewriteRule ^subfolder/(.*)$ /$1 [R=301,QSA,L] This would work just fine to redirect all files within the specific subfolder. The QSA flag is not required as the query string is preserved by default. ...
MrWhite's user avatar
  • 42.8k
1 vote
Accepted

How to Redirect Pages with Query String?

Try something like the following instead, replacing your existing RedirectMatch directive: RewriteEngine On # Redirect "/p1/p2?sort=p.model&order=ASC&page=2" and keep query string ...
MrWhite's user avatar
  • 42.8k
1 vote

Google Tag Manager / Google Analytics - multiple internal site searches and parameter cleaning of uris

I would use separate views for each. One that includes pages that start /de/live/search and one for /de/archive/search. Then you could exclude the query parameters from your main reporting view in ...
gmarsh's user avatar
  • 21
1 vote
Accepted

How to keep question mark in URL rewriting with a GET method?

RewriteRule ^search-([a-zA-Z]{2})\.php\?q\=([a-zA-Z0-9_-]*)$ pages-afficher-recherche.php?lang_abbreviation=$1&q=$2 [L] In order to check the query string part of the URL, you'll need to ...
MrWhite's user avatar
  • 42.8k
1 vote
Accepted

Query parameter for page as normal WordPress "pretty" permalink

I have found what I was looking for. Here is what I'm using: function add_query_vars($vars) { $vars[] = "parameter"; return $vars; } add_filter('query_vars', 'add_query_vars'); The above ...
HLLL's user avatar
  • 161
1 vote

Will search engines react to querystring ids as different pages?

Read Google's article about duplicate URLs and duplicate pages: https://support.google.com/webmasters/answer/139066?hl=en Also you can specify in Google Search Console which query params should be ...
user862615's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible