In my website, I have some urls with the following shape : https://www.MyShop.com/648-category-name?n=50&%253Bn=10&id_category=81
Such urls are created when a visitor changes the default quantity products per page from 20 (default value) to 50.
There is no need to index such urls. In addition such urls could be regarded as duplicate content.
1- In robots.txt, I put the following directive :
- Disallow: /*n=
2- In Google console Urls setting, I added the following parameter :
- n=
Does this parameter change page content seen by the user ?
I set : Yes: Changes, reorders, or narrows page content
How does this parameter affect page content :
I set : Other
*Which URLs with this parameter should Googlebot crawl :
I set : No URLs
3- However having done this, in Google console, I am getting a message saying that the url is blocked (on Smartphone, not on computer). It seems that the Googlebot-mobile crawler :
- indexes Urls that are supposed to be ignored by the robots.txt directive (from what I found on the internet, it seems no unsual)
- ignores the Google console Urls settings
4- To solve the matter, I wonder whether it is possible **to make a 301 redirection
- from any urls with n=
- to the url content located before the question mark**
Would anyone know what line should be added in the htaccess file to make such a redirection ?
I thank anyone in advance for any help in this matter.
Patrick