G
G
Goder2011-12-04 20:29:26
Apache HTTP Server
Goder, 2011-12-04 20:29:26

Configuring .htaccess for Googlebot to successfully view ajax content

Judging by these answers in the Google webmaster help, Googlebot can index ajax content properly if you use anchor links ('#!') correctly, and set up redirects for addresses containing _escaped_fragment_= in the request.

I use Apache with mod_rewrite as a server, the following rule is written in .htaccess for redirection: The problem is that such a rule does not work as expected: RewriteRule does not work, and redirection does not occur. In the case of this rule: the url becomes mysite.com/snapshots/snap_ACHORLINK.html?_escaped_fragment_=ACHORLINK for the link mysite.com/?_escaped_fragment_=ACHORLINK , resulting in circular redirects.
RewriteEngine on

RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule \?_escaped_fragment_=(.*) snapshots/snap_%1.html [NC,R=301,L]



RewriteEngine on

RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule ^(.*)$ mysite.com/snapshots/snap_%1.html [NC,R=301,L]




If someone can explain where the error has crept in, I will be very grateful.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question