Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Sep 2006
    Posts
    212
    cPanel/Enkompass Access Level

    Root Administrator

    Default htaccess unique for subdomain

    Is there a simple way to set up htaccess commands that only apply to a specific subdomain? I would love to have a completely different .htaccess file for the subdomain.

    I'm setting up a beta release for my site, which is at beta.mydomain.com. I need to modify a lot of the htaccess code that's currently being used on my live site, but I don't want these changes to affect the live site while I'm still in beta.

    I know that I can modify the htaccess code to include a lot of RewriteCond (checking for "beta"), but I'm just hoping there's an easier way so that if I break something, it will only kill the beta subdomain and not the entire site.

    TIA,

    Jason


    Sorry to the mods if this question belongs in another section. I wasn't sure where to put it.

  2. #2
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,894
    cPanel/Enkompass Access Level

    Root Administrator

    Lightbulb

    You should be able to use the same exact file, just edit it for the sub.domain and place it in the root of the sub domain directory.

  3. #3
    Member
    Join Date
    Apr 2009
    Posts
    230

    Default

    Assuming that 'beta' is the doc-root for the sub-domain 'beta.mydomain.com',
    simply create an htaccess file in the folder 'beta' and put the required rules in it. It would just affect the sub-domain.

Similar Threads & Tags
Similar threads

  1. Having Unique Subdomain As Server Address
    By TorchServers in forum cPGS Discussions
    Replies: 4
    Last Post: 08-05-2010, 05:12 PM
  2. Need Help with .htaccess and folder to subdomain redirect
    By bpat1434 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-25-2008, 04:30 PM
  3. Webalizer unique visitors are different from awstat unique vistors
    By BianchiDude in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-09-2006, 05:00 AM
  4. .htaccess to redirect domain.tld/subdomain to subdomain.domain.tld
    By andreseso in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-25-2006, 08:56 AM
  5. Subdomain on unique IP address
    By patrick24601 in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 12-11-2004, 09:29 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube