Hello, everybody!
I have a big trouble with my website since rewrite rules were not configurated properly. Now I have lots of pages in index of google.
the main domain is website.com
I have a rule in a .htaccess file to redirect all the users from www.website.com to website.com:
RewriteCond %{HTTP_HOST} ^www.website.com$ [NC]
RewriteRule ^(.*)$ http://website.com/$1 [R=301,L]
It's working properly, all the query parameters are transmitting to the main domain.
But now I've got a trouble.
There a lots of pages as:
haha.blabla.website.com/page
trololo.blablabla.website.com/page2.html
bla.website.com/2008/08/29/hahaha.html
and so on...
in the search engine's index.
All of the pages listed above have their proper address as:
http://website.com/page
http://website.com/page2.html
http://website.com/2008/08/29/hahaha.html
How can I make a 301 redirect from all of the subdomains to the main domain, keeping all the query parameters?
I want all of the subdomain's to be redirected to a main one.
subdomain.website.com/
subdomain1.subdomain.website.com/
subdomain2.subdomain1.subdomain.website.com/
should send me to
website.com
keeping the query string
Please, help me. :)