#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    WHMCS htaccess rewrite certain features


    Hello. First time posting, long time user of DevShed Forums.

    I have an installation of WHMCS that I'm working on, and require some features to be on sub domains, such as the knowledgebase and downloads, and status.

    I've attempted to edit this myself, however every attempt ends in failure.

    I am by no means an expert with htaccess, nor mod_rewrite so that's why I'm asking here, (i've also searched the internet in every way possible [ even trying different search engines because i know google and bing do tend to have different indexes some times.]).

    I'm at a complete loss and am pretty much at a stand still on this project until I get this figured out. Any help would be greatly appreciated. Thank you in advance.

    I have included the htaccess file that comes with WHMCS to rewrite to a directory. I can't imagine it would be hard to rewrite them to a wildcard domain.

    Code:
    RewriteEngine On
    
    # Announcements
    RewriteRule ^announcements/([0-9]+)/[a-z0-9_-]+\.html$ ./announcements.php?id=$1 [L,NC]
    RewriteRule ^announcements$ ./announcements.php [L,NC]
    
    # Downloads
    RewriteRule ^downloads/([0-9]+)/([^/]*)$ ./downloads.php?action=displaycat&catid=$1 [L,NC]
    RewriteRule ^downloads$ ./downloads.php [L,NC]
    
    # Knowledgebase
    RewriteRule ^knowledgebase/([0-9]+)/[a-z0-9_-]+\.html$ ./knowledgebase.php?action=displayarticle&id=$1 [L,NC]
    RewriteRule ^knowledgebase/([0-9]+)/([^/]*)$ ./knowledgebase.php?action=displaycat&catid=$1 [L,NC]
    RewriteRule ^knowledgebase$ ./knowledgebase.php [L,NC]
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0
    I've resolved this issue. For anyone else who's interested in doing this, you have to do the following, for homepage.tpl after creating wildcard dns records.

    Code:
    {php}$X123=$_SERVER['HTTP_HOST'];if (($X123=='support.domain.net')) {{/php}homepage data for Support{else}homepage data for regular site{/if}

IMN logo majestic logo threadwatch logo seochat tools logo