Solved

Alias for "domain to path" translation instead of VirtualHost on Apache

Posted on 2016-08-25
3
95 Views
Last Modified: 2016-08-25
Doing some development work for a website.  Trying to setup a test environment using Apache on local Windows 10 pc.

I've added an entry to Hosts file to redirect www.w2w3w2.com to localhost.  However, I also want to redirect to a filesystem folder path (i.e. other than DocumentRoot).

I tried using the following Aliases, but url was not redirected away from DocumentRoot (and no errors in error.log):
Alias /www.w2w3w2.com /w2w3w2
Alias /w2w3w2 /"D:/Documents/www/w2w3w2"
Alias /w2w3w2 /D:/Documents/www/w2w3w2
Alias /www.w2w3w2 /D:/Documents/www/w2w3w2
Alias /www.w2w3w2.com /D:/Documents/www/w2w3w2

I am using Options Indexes on DocumentRoot and can navigate to /w2w3w2 and see/execute contents, so doesn't look like an access control issues.

If I add the following VirtualHost block, then it works fine:
<VirtualHost *:80>
    DocumentRoot "D:/Documents/www/w2w3w2"
    ServerName www.w2w3w2.com
</VirtualHost>

Why can't I get the Alias directive to work?
0
Comment
Question by:SAbboushi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 58

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41770019
Alias works like this

domainname/aliasname

In other words it is seen as a virtual sub-folder of the root domain.

To do what you want requires a VirtualHosts entry.
0
 

Author Closing Comment

by:SAbboushi
ID: 41770091
Thanks Julian
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 41770358
You are welcome.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question