0
votes

I wish to implement SEO for my single page application website (assume it to be at www.myexample.com)

After reading Google's documentation (https://developers.google.com/webmasters/ajax-crawling/docs/getting-started) I started by attempting this for the website's home page. That means, www.myexample.com?_escaped_fragment_= should 'map to' www.myexample.com/staticIndex.html

I added the following to .htaccess file in the website's public_html folder:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=
RewriteRule ^_escaped_fragment_= /staticIndex.html [PT]

After this change, when I try the URL www.myexample.com?_escaped_fragment_= in browser, I expected the browser to show me content of file staticIndex.html Instead, it shows me content of www.myexample.com (index.html) and the browser URL remains unchanged to www.myexample.com?_escaped_fragment_=

Could someone help me with the RewriteRule?

Thanks.

1

1 Answers

2
votes

try this:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=$
RewriteRule (.*) staticIndex.html [PT]