I am trying to make my single page application crawlable by google and for this reason I have to implement redirect for urls that starts with ?_escaped_fragment_
.
I found this highly relevant question and a nice answer there (there are couple of duplicates there as well). I tried both approaches (before both of them I have RewriteEngine On
):
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule ^$ /webroot/crawler.php%1 [QSA,L]
and
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule ^$ /webroot/crawler.php [QSA,L]
But in both cases I my urls http://localhost/?_escaped_fragment_
are not redirected. My apache has no problems during restarts.
I assume that the problem can be because I am modifying my apache.conf file (/etc/apache2/sites-available/000-default.conf
) and not the .htaccess
. I also enabled a2enmod rewrite
.
I also added this into my apache.conf:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
Does anyone has an idea what might be the problem?