Apache alias to the default DocumentRoot
Posted: 14. December 2006 16:06
PROBLEM SOLVED! Don't bother reading this unless you're having the same issue I had.
Okay, I've been trying to get this to work for over an hour now, but I kept getting either a 403 or a 404 error no matter what I try...
My DocumentRoot is "D:/Webs" because my websites are stored there. I want to have access to the XAMPP control panel though, so I thought I'd define an Alias: Alias /config/ "C:/Program Files/xampp/htdocs"
Of course I need to allow access outside of the DocumentRoot, so I added this Directory entry:
The result:
URL http://localhost/config/index.html
LOG 127.0.0.1 - - [14/Dec/2006:15:52:54 +0100] "GET /config/index.html HTTP/1.1" 403 1147
ERR [Thu Dec 14 15:53:35 2006] [error] [client 127.0.0.1] client denied by server configuration: C:/Program Files/xampp/htdocsindex.html
So I figured I'd have to add a trailing slash to the alias destination path as such: Alias /config/ "C:/Program Files/xampp/htdocs/"
That produces a nice "It works!" page, but when I now visit http://localhost/config/ instead of http://localhost/config/index.html, I'm being redirected to http://localhost/xampp/ which points to D:\Webs\xampp
While writing this I figured out that there's also an index.php file which takes priority over the .html and is causing the redirect . I'll post this anyway in case anyone else is having similar problems and stumbles upon this page.
The solution:
http://uwhost.net
Okay, I've been trying to get this to work for over an hour now, but I kept getting either a 403 or a 404 error no matter what I try...
My DocumentRoot is "D:/Webs" because my websites are stored there. I want to have access to the XAMPP control panel though, so I thought I'd define an Alias: Alias /config/ "C:/Program Files/xampp/htdocs"
Of course I need to allow access outside of the DocumentRoot, so I added this Directory entry:
- Code: Select all
<Directory "C:/Program Files/xampp/htdocs">
Options Indexes MultiViews FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
The result:
URL http://localhost/config/index.html
LOG 127.0.0.1 - - [14/Dec/2006:15:52:54 +0100] "GET /config/index.html HTTP/1.1" 403 1147
ERR [Thu Dec 14 15:53:35 2006] [error] [client 127.0.0.1] client denied by server configuration: C:/Program Files/xampp/htdocsindex.html
So I figured I'd have to add a trailing slash to the alias destination path as such: Alias /config/ "C:/Program Files/xampp/htdocs/"
That produces a nice "It works!" page, but when I now visit http://localhost/config/ instead of http://localhost/config/index.html, I'm being redirected to http://localhost/xampp/ which points to D:\Webs\xampp
While writing this I figured out that there's also an index.php file which takes priority over the .html and is causing the redirect . I'll post this anyway in case anyone else is having similar problems and stumbles upon this page.
The solution:
- Code: Select all
Alias /config/ "C:/Program Files/xampp/htdocs/xampp/"
http://uwhost.net