I'm trying to redirect (internally) example.com/snippets/_filename_ to example.com/snippets/?f=_filename_ using mod_rewrite... And it is not working.

The contents of my .htaccess file, which is placed inside of the snippets directory are:

RewriteEngine On
RewriteRule ^snippets/([^/\.]+)$ /snippets/?f=$1 [L]

This solution, but it doesn't seem to work on my Apache 2.4 server, and instead causes a 404 Error.

  • did you check your apache error log to see what it's trying to get? maybe that will be the clue to where it's gone wrong. – user16081-JoeT Jul 7 '15 at 2:21
  • unfortunately not; still getting the same result. – Hussain Khalil Jul 7 '15 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.