The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AliasMatch directives

Discussion in 'General Discussion' started by bpmod, Mar 3, 2009.

  1. bpmod

    bpmod Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    I just updated Apache using EasyApache and I am trying to figure out how to replace the Alias & AliasMatch directives that used to be in the httpd.conf file.

    I have been reading the instructions at http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html but I am not quite getting it.

    In the old system I had, for example:
    Alias /something /home/user/path/something.php
    AliasMatch ^/somethingelse/[0-9]{6}$ /home/user/path/somethingelse.php

    1. Do I create an include file with these lines? same syntax?
    2. What do I name it?
    3. How do I tell Apache to find and load it?

    Thanks for any help.

    Brian
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Whenever I've needed to do things like this (aliases within the same user path), I've used Rewrite Rules (from mod_rewrite) and Redirect Rules in .htaccess files. Note that mod_rewrite is enabled on all cPanel/WHM 11 servers.

    I usually avoid mucking with httpd.conf unless I cannot avoid it..
     
  3. bpmod

    bpmod Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    Thanks David

    But httpd.conf is the only way that I learned how to do these things, and I had about 2 dozen or so Aliases set up that way. Now I have 2 dozen or so urls that don't work, across 5 or 6 domains. I am not above learning a "new trick", but I don't know anything (yet) about mod_rewrite.

    Could you point me in the right direction?

    Thanks

    Brian
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If you're familiar with regex (which it appears you are since you have used AliasMatch), learning how to use mod_rewrite will be easy for you.

    The Apache 2.0 docs on this are available at:
    http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

    For Apache 2.2: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
    For Apache 1.3: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
     
Loading...

Share This Page