0

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?

Community
  • 1
  • 1
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
  • A few ideas (probably most of them are done by you, but maybe not.): You should turn on mod rewrite as well. You should verify if it works. (with something trivial, or enable its logging.) Maybe it is enabled only for an other vhost, or inside an other context. – Lajos Veres May 01 '14 at 11:39
  • @LajosVeres thanks but I wrote that I enabled it by running `a2enmod rewrite` – Salvador Dali May 01 '14 at 11:45
  • AFAIK enable loads only the module. I don't think it adds 'RewriteEngine On'. – Lajos Veres May 01 '14 at 12:54
  • @LajosVeres I also added `RewriteEngine On`. And I also wrote about it. – Salvador Dali May 01 '14 at 18:39

0 Answers0