Page 1 of 1

Alias directive not working

PostPosted: 04. June 2014 04:52
by tskmatrix
I have the following directives in my httpd.conf file...
Code: Select all
Alias /design.tskmatrix "C:/xampp/design.tskmatrix"
<Directory "C:/xampp/design.tskmatrix">
    Options +Indexes +FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Alias /frontend/, "C:/xampp/ecomm/frontend/web/"
<Directory "C:/xampp/ecomm/frontend/web/">
    Options +Indexes +FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Alias /backend/, "C:/xampp/ecomm/backend/web/"
<Directory "C:/xampp/ecomm/backend/web/">
    Options +Indexes +FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

The first one works just fine but the other 2 do not. I get 404 not found errors. Any help would be appreciated.

Re: Alias directive not working

PostPosted: 04. June 2014 05:44
by Altrea
Compare The last two Alias With The First One. I bet you will See The difference too

Re: Alias directive not working

PostPosted: 04. June 2014 12:47
by tskmatrix
This is for a Yii 2.0 site and requires the following...
Set document roots of your Web server:
for frontend /path/to/yii-application/frontend/web/ and using the URL http://frontend/
for backend /path/to/yii-application/backend/web/ and using the URL http://backend/
So, I want to point to the frontend/web directory but I want the address to be http://localhost/frontend/
Can xampp set multiple Document Roots, or do I have to use VirtualHosts?

Re: Alias directive not working

PostPosted: 04. June 2014 13:21
by Nobbie
tskmatrix wrote:This is for a Yii 2.0 site and requires the following...


You did not follow the advice of Altrea. Only your first ALIAS is correct, the next two are WRONG. Watch them carefully and find out the difference. I will give a huge hint: whatch out for useless commas...

tskmatrix wrote:Can xampp set multiple Document Roots, or do I have to use VirtualHosts?


VirtualHosts. But VirtualHosts is useless if you want to address http://localhost/frontend/ (you should use ALIAS instead, as you already did, but your ALIAS is syntactically wrong, see above). If you wnt to use http://frontend/ instead, you have to use VIrtualHosts.