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

232 views Asked by At

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]

0

There are 0 answers