• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

How do i make an alias on my webserver?

Hi experts,

How do i make an alias on my webserver?

i have images on my machine located in /home/me/images/. i would like to be able to access them on /home/httpd/htdocs/

i have tried this:
Alias /home/me/images/ "/home/httpd/htdocs/cctvimages/"
Alias /cctvimages/ /home/me/images/

the first just displays parent directory (go back), the seocnd shows an error: Forbidden: you dont have permission to access/cctvimages/

i have mkdir cctvimages in /home/http/htdocs/cctvimages

  • 2
1 Solution
Hi Mel,

Much detailed discussion on Alias: http://httpd.apache.org/docs/mod/mod_alias.html

/home/httpd/htdocs is your DocumentRoot - where the default pages will be served.

In your case, you would need to map your alias to a different physical directory and make it appear as it is coming from the webroot.  One way is using OS Symbolic link feature.

Or you could use Apache Alias directive (as you wish),

If you want the files in /home/me/images to be available in http://www.yourserver.com/images, then you would need to have the following Alias

Alias /images     /home/me/images

<Directory "/home/me/images">
   Options Indexes MultiViews
   AllowOverride None
   Order allow,deny
   Allow from all

And make sure that you had reset permission for /home/me/images folder to be at least world-readable.  chmod 755 /home/me/images would do.  To check, try to "su - apache" and try to "cd /home/me/images"

good luck.
melawaisiAuthor Commented:
thanks. i actually got something similar, after researching, but your answer is perfect. cheers
hi Mel,


Just feel free to ask should you need more assistance.


Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now