Solved

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

Posted on 2016-08-25
3
90 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 57

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 57

Expert Comment

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

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
What You Need to Know when Searching for a Webhost Provider
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 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