I have a website that is not on ASP anymore, it's a Drupal 7 website now.
I need to use an .htaccess file to redirect with code 301 all pages with .asp extension to the 404 page or a specific URL.
(Background story: Drupal will catch non-existing pages such as domain.com/test
and redirect to 404 page. But Drupal will not catch non-existing pages with ASP extension such as domain.com/test.asp
and it will instead serve a generic Not Found Apache page.)
For example, if someone tries to access domain.com/test.asp
, the user should be taken to domain.com/404
I have searched and searched but I can't find a solution to this particular problem. How can I code that in an .htaccess file?
/does-not-exist
I get the Drupal 404 page. If I go to/does-not-exist.asp
I get what seems to be an apache pageNot Found The requested URL "/does-not-exist.asp" was not found on this server.
– leonel Sep 11 '13 at 15:03