Results 1 to 2 of 2

Thread: Can you make a virtual directory path

  1. #1
    Join Date
    Aug 2019
    Beans
    1

    Can you make a virtual directory path

    I'm very new to ubuntu and have just set up my webserver. What I am wondering is if there is a way to create virtual directory paths.
    I have a real directory at www.[mydomain].com/rin/tmpl/images
    I would like to be able to have www.[mydomain].com/myimages act as an alias to the real directory that I listed first.

    So that
    www.[mydomain].com/rin/tmpl/images would show the same contents as www.[mydomain].com/myimages
    and
    www.[mydomain].com/rin/tmpl/images/cab.jpg would show the same file as www.[mydomain].com/myimages/cab.jpg

    Is this something that is possible?

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    14,214
    Distro
    Kubuntu 19.04 Disco Dingo

    Re: Can you make a virtual directory path

    If you're using Apache, the simplest method is with an Alias statement in the definition for the VirtualHost.

    Code:
    <VirtualHost *:80>
    ServerName
    [etc.]
    Alias /myimages /path/to/www.[mydomain].com/rin/tmpl/images
    [etc.]
    You'll need to enter the complete path to the aliased directory.

    The other option is to use symbolic links, commonly called "symlinks." These operate at the operating system level. By default, symlinks are disabled in Apache, but you can add the directive "Options FollowSymlinks" in the <Directory> stanza for any directories you want them enabled.
    Last edited by SeijiSensei; 1 Week Ago at 12:49 AM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •