Alias directive not working

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Alias directive not working

Postby tskmatrix » 04. June 2014 04:52

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.
tskmatrix
 
Posts: 2
Joined: 04. June 2014 04:43
Operating System: Win 7

Re: Alias directive not working

Postby Altrea » 04. June 2014 05:44

Compare The last two Alias With The First One. I bet you will See The difference too
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Alias directive not working

Postby tskmatrix » 04. June 2014 12:47

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?
tskmatrix
 
Posts: 2
Joined: 04. June 2014 04:43
Operating System: Win 7

Re: Alias directive not working

Postby Nobbie » 04. June 2014 13:21

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.
Nobbie
 
Posts: 8761
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 55 guests