Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

vhost template

Discussion in 'General Discussion' started by ozzieonline, Jan 16, 2013.

  1. ozzieonline

    ozzieonline Well-Known Member

    Dec 20, 2012
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    I was finally able to rewrite internally to home/xxx/public_html/website/

    I adjusted the vhost.local template and added this line:

    AliasMatch ^/website/(.*)$ /home/xxx/public_html/website/[% vhost.servername %]/$1

    As you can see I used the [% vhost.servername %] variable from the template to retrieve the domain name. Works like a charm and I was all happy (took me a few hours to find out)... untill... I tried to add an add-on domain.

    The problem is that in an add-on domain the value of this [% vhost.servername %] is something like this while it should have been this As a result my solution for the AliasMatch doesn't work anymore. Very frustrating.

    Is there a way to modify [% vhost.servername %] in the template file? For example is there a way to strip the part between the dots so becomes

    Please help! (If this is not possible then I would like to know as well.)

Share This Page