jeudi 25 juin 2015

Display 404 error document for invalid urls from apache without hitting rails application

Is it possible to show 404.html error document for invalid URLs using RewriteRule from Apache before it hits Rails application.

We have routes like /website/stats_for_season/1031475/23 in our application. But for some reason google bot is accessing URLs like /website/stats_for_season/1031475 without last part.

I have added below rule to Apache .conf file, without success.

RewriteRule ^website/stats_for_season/([0-9]+)/$ '' [R=404] [L]

Aucun commentaire:

Enregistrer un commentaire