Shorcut issue with Apache on Windows

I usually use Linux, but a few days ago my wireless driver stopped working. I don’t know why, anyway, no time to figure it out. So I have to use Windows when developing websites with Apache.

I’ve already installed Zend Server (which has a built-in Apache) but I found my site running more slowly than usual. So I decided to install XAMPP as a replacement. The problem here is, when I tried to create a shortcut in the XAMPP’s htdocs folder pointing to the Zend Server’s htdocs folder, which contains my old site, Apache didn’t “follow” them, even if the FollowSymLinks option is enabled. Then after a quick search, I’ve found the solutions: Use the Alias!

Yeah, using Alias is very easy. You can find its documentation here: http://httpd.apache.org/docs/2.0/mod/mod_alias.html

All you have to do is insert a single line in the http.conf:
Alias /old-site /full/path/to/your/folder

This will tell Apache to treat (in my case) http://localhost/old-site as an alias for the full path to your external folder (outside the your document root) .The full path is the actual file path, in my case: C:\….\Zend\Apache2\htdocs\…

And last but not least, remember to permit access to the external folder, like this:

<Directory /path/to/your/folder> –>Use ‘/’ instead of ‘\’ for path separator!

Order allow,deny

Allow from all

</Directory>

About javarchive

I'm swimming into the depth of Java world
This entry was posted in Tips and tagged , , , . Bookmark the permalink.

Leave a comment