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.

Subdomain to main domain

Discussion in 'Security' started by Jiannuccio, Oct 26, 2012.

  1. Jiannuccio

    Jiannuccio Registered

    Joined:
    Oct 26, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I've reinstalled my whole webserver and I'm reconfiguring everything.

    I've got a problem with subdomains:

    I need that subdomain.domain.com points to domain.com because i'm using CodeIgniter and i need that it will be read as domain.com/subdomain

    I wrote this in .htaccess:

    RewriteCond %{HTTP_HOST} ^([a-z0-9-_]+|!www).domain.it$
    RewriteCond $1 !^(index\.php|images|uploadify|robots\.txt|aziende|blog)
    RewriteRule ^(.*)$ /index.php/%1/$1 [L]

    I think this code is right because before reinstalling it worked. Maybe i've not set something...

    mod_rewriting is working because link domain.com/subdomain is working correctly
     
  2. Jiannuccio

    Jiannuccio Registered

    Joined:
    Oct 26, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Resolved, in httpd i put alias in domain.com : *.domain.com
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Editing httpd.conf directly will be wiped upon Apache recompile or rebuild. The better option would have been to add *.domain.com to cPanel > Subdomains area.
     
Loading...

Share This Page