Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-08-25
3
Medium Priority
?
101 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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.
What You Need to Know when Searching for a Webhost Provider
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

719 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