My site is a single page web-app. I am following the suggestions based on making AJAX applications crawl-able.
My URL looks like this:
http://domain.com/#!pages/contactUs
My understanding is:
http://domain.com/#!chair/12
goes to http://domain.com/?_escaped_fragment=chair/12
As I am not using any server-side scripting on this project, I have created HTML pages with the application states and put them in a folder like so:
http://domain.com/htmlFiles/1.html
In Apache I have forwarded requests that include _escaped_fragment_=
to the right html page:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=chair\/([\w]*)
RewriteRule ^(.*)$ htmlFiles/%1.html? [R=302,L]
The forwarding works correctly and the appropriate page shows up if the _escaped_fragment
URL is used.
The sitemap I submitted to Google looks like this:
<url>
<loc>http://domain.com/#!pages/contactUs</loc>
<lastmod>2012-12-30</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
The problem now is this:
my whole htmlFiles
folder (http://domain.com/htmlFiles/1.html
) with the HTML files is indexed in Google. These pages are there in the first place just to show Google what content my actual pages contain.
My entire website works from
http://domain.com/
These pages should not be coming up in the search results. As they had said they will only index pretty URLs, but still, I am reluctant to have them remove these pages as I don't know if it's going to hamper something else.
Could it be that 302 is not the right redirect and 301 should be used instead?
Also is there something wrong with this redirect approach thing in the first place?