You can make a catch-all rewrite rule for apache that acts somewhat like an alias, but can be implemented in a
.htaccess file while an alias can't.
As an example, assuming your document root is a hierarchy like this:
/.htaccess /test/ /test/.htaccess /test/file
You can "Alias" all requests to the test folder by making the root
RewriteEngine On RewriteRule ^(.*)$ /test/$1 [L]
And the second
This works great, and usually is all you need. It just has one problem – it creates multiple valid urls. Now you can access the file with both
Ordinarily this isn't a problem, but if you add a file called
/test/test you'll see the problem, as the fake alias stops working entirely. If the subfolder has a complex
.htaccess of its own it can cause major headaches.
Is there any way to fake an alias from a
.htaccess without the original urls still working? (Any
RewriteCond for the subfolder that would check if we've already been rewritten or not?)