Mobile app version of vmapp.org
Login or Join
Jennifer507

: Links on Google result list with unnecessary parameters I have a website that uses .htaccess to turn the parameterized URLs into a folder pattern based URL For example : www.example.com?lang=de&cat=mycategory

@Jennifer507

Posted in: #CanonicalUrl #Google #Htaccess #Seo #UrlRewriting

I have a website that uses .htaccess to turn the parameterized URLs into a folder pattern based URL

For example :
example.com?lang=de&cat=mycategory


becomes
example.com/de/mycategory

Now Google lists this page as
example.com/de/category?lang=de&cat=mycategory

in its result list and I don't know why. I check the website's source code but the link example.com/de/category?lang=de&cat=mycategory is not in the source code, so I don't know why Google comes up with this kind of link.

The rewrite rule in my .htaccess file looks like this:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^de/mycategory /index.php?lang=de&cat=mycategory [NC,L]

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jennifer507

1 Comments

Sorted by latest first Latest Oldest Best

 

@Welton855

The source of your problem can be in html or in javascript, and you cannot control the links that other people put on the net too.. And because he finds a page when making a request for it, it indexes it. I miss some information to give answer with code (using a CMS? Other rules in .htaccess, etc…), but here are some ways :


Write a permanent redirect in .htaccess to remove the query string,
but then beware of the redirect loop (/de/mycat ->
/index.php?lang=de&cat=mycat -> index.php)
Usually this kind of situation is managed by the CMS: everything
that is not a static file existing on disk goes to index.php file,
which will check for the correctness of url and send redirects if
needed.
You should also go to Google Webmaster Tools, and have a look where
they give crawling statistics. There is a page where you can tell
them what does which parameters in URL.
Use a robots.txt file to disallow Google/other bots from crawling and indexing some of your files.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme