I am running Linux Mint 21.3 Cinnamon, and installed XAMPP 7.4.33 because I want to test a web application using a particular version of PHP. XAMPP installs Apache of course, and the first thing I want to do is to get the Alias
directive working.
XAMPP installs to /opt/lampp/
and inside there is a directory htdocs
and inside here, I created a directory called alias-test
, and then 2 subdirctories called old
and new
.
So the structure is like this...
/opt/
lampp/
htdocs/
alias-test/
old/
new/
test.html
At this point, with Apache running, I can browse to http://localhost/alias-test/old/ and to http://localhost/alias-test/new/ and as expected, in both cases, I get an Apache-generated listing of the files in these directories – that is, the "old" directory shows as empty, and I can see the "test.html" file inside the "new" directory.
Now, what I want to achieve is to be able to navigate to http://localhost/alias-test/old/test.html and for Apache to load the file /opt/lampp/htdocs/alias-test/new/test.html
. So in /opt/lampp/htdocs/alias-test/
I created a .htaccess
file and put this inside...
Alias /alias-test/old /opt/lampp/htdocs/alias-test/new
Now if I navigate to http://localhost/alias-test/old/test.html I get an Apache error:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
localhost
Apache/2.4.54 (Unix) OpenSSL/1.1.1s PHP/7.4.33 mod_perl/2.0.12 Perl/v5.34.1
So, what's going on? What have I overlooked to get this minimal viable example working?