1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice

old problem: subdomain with www - almost solved

Discussion in 'Plesk for Linux - 8.x and Older' started by HMnet, Jun 24, 2005.

  1. HMnet

    HMnet Basic Pleskian

    24
    73%
    Joined:
    Mar 30, 2004
    Messages:
    32
    Likes Received:
    0
    old problem: subdomain with www - SOLVED

    Hi @all!

    I have this old problem: I want to create a subdomain with www. in front of it.

    I use Plesk 7.5.3 with SuSe 9.1.

    I tried to use DNS settings, but that doesn't really function. As anyone knows. :)

    So I testet the version with the vhost.conf file.

    This is my vhost.conf:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteMap lowercase int:tolower
    ServerAlias www.<sub>.<domain>.com
    RewriteCond %{HTTP_HOST} ^www.<sub>.<domain>.com$
    RewriteCond %{REQUEST_URI} !^/home/httpd/vhosts/<domain>/subdomains/<sub>/httpdocs/
    #RewriteCond %{REQUEST_URI} !error_docs
    RewriteRule (.*) /home/httpd/vhosts/<domain>/subdomains/<sub>/httpdocs/$1
    </IfModule>

    OK. The browser opens the right site, but PHP is disabled. So the browser wants to download the *.php files.

    :eek:

    Has anybody a solution for that problem?

    Thanx!

    HMnet
     
  2. HMnet

    HMnet Basic Pleskian

    24
    73%
    Joined:
    Mar 30, 2004
    Messages:
    32
    Likes Received:
    0
    SOLVED!

    Hi!

    I just figured it out :D.

    For anyone who is interested in:

    Add the following syntax in your vhost.conf file and you will have a ServerAlias www.<sub>.<domain>.com for your subdomain:

    OK, that's it.

    HMnet :cool:
     
  3. faris

    faris Guest

    0
     
    Thanks HMet. That's very useful.

    Faris.
     
  4. Hultenius

    Hultenius Guest

    0
     
    Yeah, thank you!

    Had one customer complaining about the www-before-subdomain-problem today.
    This fix made the problem go away easy :)
     
  5. Jllynch

    Jllynch Regular Pleskian

    28
     
    Joined:
    Nov 11, 2003
    Messages:
    242
    Likes Received:
    0
    To get this one to work did you need to put www.sub.domain.com in the dns for the domain?
    I currently have tried the above but have www... redirecting directly to sub.domain...
    I only got that far after adding www.sub... to the dns.
     
  6. jamesyeeoc

    jamesyeeoc Guest

    0
     
    Actually, yes. I think I forgot to post that fact in another thread recently. Can be either a CNAME or A record.

    www.sub.domain.com. CNAME sub.domain.com.

    www.sub.domain.com. A xx.yy.zz.nn
     
Loading...