<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged google-webmaster</title>
<link>https://www.question2answer.org/qa/tag/google-webmaster</link>
<description>Powered by Question2Answer</description>
<item>
<title>Strange bahevior when rewrite.</title>
<link>https://www.question2answer.org/qa/51257/strange-bahevior-when-rewrite</link>
<description>

&lt;p&gt;Hi guys,
&lt;br&gt;I am using pretty URL's.
&lt;br&gt;My website experience some strange behavior.
&lt;br&gt;I am using force rewrite to www. and when you look at the URL of any question it appears like that
&lt;br&gt;&lt;strong&gt;1. www.mywebsite.com/999/question-title&lt;/strong&gt;&amp;nbsp; 999 is the question number.
&lt;br&gt;
&lt;br&gt;For some reason if you remove the www. then the url gets rewriten like that:
&lt;br&gt;&lt;strong&gt;2. www.mywebsite.com/index.php?qa-rewrite=999/question-title &lt;/strong&gt;or
&lt;br&gt;&lt;strong&gt;3. www.mywebsite.com/index.php?qa-rewrite=999/question-title&amp;amp;show=999#q999 &lt;/strong&gt;&amp;lt;= I could not reproduce at what conditions i've got this URL...
&lt;br&gt;
&lt;br&gt;I am using sitemap plugin.
&lt;br&gt;In google webmaster I found 25% of my website with error 404 because google have try to index the #2 URL's
&lt;br&gt;What can I do so google do not try to index this URL's or send him correct data?
&lt;br&gt;In &lt;strong&gt;XML Sitemap &lt;/strong&gt;I have excluded all except the question pages.
&lt;br&gt;
&lt;br&gt;Here is my current .htaccess
&lt;br&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;
&lt;br&gt;RewriteEngine On
&lt;br&gt;RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
&lt;br&gt;RewriteRule .* – [F,L]
&lt;br&gt;#RewriteBase /
&lt;br&gt;RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
&lt;br&gt;RewriteRule . %1/%2 [R=301,L]
&lt;br&gt;RewriteCond %{REQUEST_FILENAME} !-f
&lt;br&gt;RewriteCond %{REQUEST_FILENAME} !-d
&lt;br&gt;RewriteRule ^.*$ index.php?qa-rewrite=$0&amp;amp;%{QUERY_STRING} [L]
&lt;br&gt;RewriteCond %{HTTP_HOST} .
&lt;br&gt;RewriteCond %{HTTP_HOST} !^www\.mywebsite\.com [NC]
&lt;br&gt;RewriteRule (.*) &lt;a href=&quot;http://www.mywebsite.com/$1&quot; rel=&quot;nofollow&quot;&gt;http://www.mywebsite.com/$1&lt;/a&gt; [R=301,L]
&lt;br&gt;&amp;lt;/IfModule&amp;gt;&lt;/p&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/51257/strange-bahevior-when-rewrite</guid>
<pubDate>Sun, 10 Apr 2016 06:49:00 +0000</pubDate>
</item>
</channel>
</rss>