Rewriting a blank html page

23 views
Skip to first unread message

Peter Whitfield

unread,
Sep 5, 2016, 7:43:44 AM9/5/16
to UrlRewrite
Apologies, the subject probably doesnt make it clear.

I found what appeared to be a massive issue with our google results two days ago where we suddenly dropped from page 1 to 10. After a lot of digging it appeared we hadnt dropped as such but the pages we were seeing were different ones and the main index.php page simply didnt appear in google anymore.

When Ive checked all avenues I see that 6 days ago and onwards google crawl is finding a single error, that error relates to www.mysite.com/.html < note the lack of a page name.

We currently rewrite the URI's to take a PHP parameter and use that as the basis of a .html page

ie www.mysite.com/services.php?product=Ice+Cream+cone

becomes
www.mysite.com/ice+cream+cone.html

I think therefore that there must be a link somewhere in gogles crawl that is taking a blank parameter and creating the .html page, google then throws an error. This is where I think google is then somehow seeing this as being the index page and reporting it to be dead.

If that is the case I want to rewrite any {blank}.html to redirect it to the index.php page but Im very wary of how to do this without mucking the entire site up!

Could anyone point me in the correct direction to rewrite

www.mysite.com/.html to www.mysite.com  {or} www.mysite.com/index.php

is it literally.....

RewriteRule ^http://www.mysite.com/.html$ http://www.mysite.com [L,R=301]

Reply all
Reply to author
Forward
0 new messages