bpmod

Well-Known Member
Sep 23, 2004
49
0
156
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
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
13
313
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..
 

bpmod

Well-Known Member
Sep 23, 2004
49
0
156
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
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
13
313
Houston, TX
cPanel Access Level
Root Administrator
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
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