: Htaccess 301 redirect help needed(removing GET parameters) Due to some issues in my site many pages are visible as duplicate using : www.example.com/page.html?task=view but it's content is exactly
Due to some issues in my site many pages are visible as duplicate using : example.com/page.html?task=view but it's content is exactly same as example.com/page.html.
One way is to use http 301 redirect from example.com/page.html?task=view to example.com/page.html when anybody fetches page with arguments. But links like example.com/page.html?task=view will remain visible to outside world.
Another way is canonicalization which I don't want to use as it is difficult to insert the tag in Joomla CMS.
I want to hide example.com/page.html?task=view from external world.
Is it possible to change the url from example.com/page.html?task=view to example.com/page.html ? I mean if there is href link of example.com/page.html?task=view in my web page, it should be visible to external world as without any arguments. This is different from using 301 to convert externally accessed page : example.com/page.html?task=view to without using arguments in .htaccess.
More posts by @Steve110
4 Comments
Sorted by latest first Latest Oldest Best
If your app / CMS works without that specific CGI parameter, you could strip the parameter via a rewrite rule, in either a .htaccess or httpd.conf file e.g.
RewriteEngine On
RewriteCond %{QUERY_STRING} task=view
RewriteRule page.html %{REQUEST_URI}? [R=301,L]
I guess this is possible by using BOTH .htaccess 301 redirects and URL rewriting.
You can use URL re-writing but, if you have 2 pages with the same content which uses querystrings, my research shows Google will not penalize you, they will simply ignore one of the pages (and my guess is the one with the querystring).
I would also consider though if you want this 'forwarder' in place to add it with code.
If you mean pages visibility to Googlebot, I recommend you to use their Webmaster tools panel like described here: support.google.com/webmasters/bin/answer.py?hl=en&answer=1235687 . It describes how you can set up you site parameters to avoid Google to crawl and index pages with identical content.
If you have not yet installed Google Webmater tools for you site, I recommend you to do so at www.google.com/webmasters/tools/
If you want to reach some invisibility of the pages from other search engines bots try some experiments with robots.txt file, like so:
User-agent: *
Disallow: /*?task=view
This will block all URLs containing "?task=view" to be crawled by robots.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.