Hi guys,
I am using pretty URL's.
My website experience some strange behavior.
I am using force rewrite to www. and when you look at the URL of any question it appears like that
1. www.mywebsite.com/999/question-title 999 is the question number.
For some reason if you remove the www. then the url gets rewriten like that:
2. www.mywebsite.com/index.php?qa-rewrite=999/question-title or
3. www.mywebsite.com/index.php?qa-rewrite=999/question-title&show=999#q999 <= I could not reproduce at what conditions i've got this URL...
I am using sitemap plugin.
In google webmaster I found 25% of my website with error 404 because google have try to index the #2 URL's
What can I do so google do not try to index this URL's or send him correct data?
In XML Sitemap I have excluded all except the question pages.
Here is my current .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* – [F,L]
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.mywebsite\.com [NC]
RewriteRule (.*) http://www.mywebsite.com/$1 [R=301,L]
</IfModule>