Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a static HTML website.

www.example.com/?12345 (this page doesn't exist) redirects to www.example.com and www.example.com/page.html?12345 redirects to www.example.com/page.html. I don't know why this happens.

Google said this is a soft 404 error and www.example.com/page.html?12345 should return a 404 response not a 200 OK response.

How can I fix this ?

Here's my .htaccess:

RewriteEngine On 
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# Cache
# 1 month
<filesMatch ".(jpg|jpeg|png|swf)$">
Header set Cache-Control "max-age=2592000, private"
</filesMatch>
# 3 days
<filesMatch ".(txt|css|js)$">
Header set Cache-Control "max-age=259200, must-revalidate, proxy-revalidate"
</filesMatch>
# 10 min
<filesMatch ".(html|htm)$">
Header set Cache-Control "max-age=3600, public, must-revalidate, proxy-revalidate"
</filesMatch>

# Include php
<Files contact.htm>
AddHandler application/x-httpd-php5 htm
</Files>
share|improve this question
    
Please share your .htaccess file. –  bybe Apr 3 '13 at 12:47
    
Please add it to your question (no comment) with proper formatting. –  bybe Apr 3 '13 at 13:31
    
Added to my question. –  Snapped Apr 3 '13 at 13:42
add comment

1 Answer 1

No idea where you got that soft error notice.

The behavior you see is completely normal. If you have a page and someone adds parameters to it, any parameter not used by the page are and should be ignored.

If you only want naked URLs to work and all URLs with parameter to return a 404 then you will have to add specific htaccess rules for that. Something like:

RewriteCond ${QUERY_STRING} !^$
RewriteRule .* - [R=404,L,NC]
share|improve this answer
    
Thank you Itai & bybe. I'll try this. –  Snapped Apr 3 '13 at 16:28
    
The soft error notice referred to in this question would have been from Google Webmaster Tools. A soft error is essentially a Page-not-found error page but without the appropriate HTTP 404 code in the response headers. –  richhallstoke Jul 7 at 9:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.