Activate mod_rewrite
, and put this in a .htaccess file or a <Directory>
directive:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !^apps/
RewriteRule (.*) apps/$1
What it does:
The first three lines check if the requested URI refers to an actually existing file, directory or link, in order to make sure that e.g. an index.html
at top level is still delivered if requested.
The fourth line makes sure that the user has not already requested an URI in the apps/
subpath.
If the requested URI is not an existing file, directory or link and does not start with apps/
, the path of the URL is taken and apps/
is prepended. This only happens internally.