Apache: Clean URLs with FallbackResource

November 15, 2018

I only just now learned about the FallbackResource directive in Apache, which is a very basic alternative to the Rewrite module, eg. when you want clean URLs.

.htaccess example:

FallbackResource /index.php

Apache will then use the index.php file, unless the file or directory exists - so all your images, css and js files will still work.

Read the full documentation here: https://httpd.apache.org/docs/2.4/mod/mod_dir.html

This is a very simple and easy solution for "rewriting", without needing the rewrite module, but of course won't always be enough.

Follow RSS/Atom Feed
See more posts