Visit Sponsor

Written by 8:22 pm Apache

Apache, Directory Aliases and Virtual Directories

I realized I misconfigured Apache the other day.
Apache wasn’t serving files from my virtual directory, rather from the root folder named the same. After looking at my Apache configuration, I noted I was missing a leading slash in my Alias directive. Sort of hard to spot, so I hope this helps someone else.This is the misconfigured version: ( Bad )

Alias /portal "C:\httpd\Apache2\htdocs\Portal\www"

Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all

This is the one that works: ( Good )

Alias /portal/ "C:/httpd/Apache2/htdocs/Portal/www/"

Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all

Note: The slashes have been changed from \ ( Windows Style ) to / ( Unix Style ). For some reason this mattered…..

Visited 100,599 times, 1 visit(s) today
[mc4wp_form id="5878"]
Close