• Hi there,

    for my website https://tolotoys.com I need to install various additional sites, and I wanted to use subdomains. I have set the following:

    1) ServerAlias *.tolotoys.com in the vhosts entry
    2) added the A *.tolotoys.com and CNAME *.tolotoys.com in the dns settings

    I’m running PLESK

    When I create a site, such as I tried with https://it.tolotoys.com it redirects to some other weird site (check the link to see).

    Does anyone have an idea what could be wrong?

    Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mikewire

    (@mikewire)

    I’ve followed the steps in that article

    1) Set the webmail services to resolve before the subdomain names (in /etc/httpd/conf.d/)
    2) Set the Domain wildcard subdomains in Apache (in /var/www/vhosts/domain.com/conf/)
    3) Set the DNS to know where to send page requests with wildcard domain addresses (in DNS settings)
    4) Reset the Permalinks of your WordPress Home blog (don’t mistakenly do it in a sub blog and wonder why it’s not working … like I’ve done before).

    Any idea what could be wrong?

    These are the contents of my .htaccess file:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule . index.php [L]

    <ifModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>

    # compress the files
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
    # removes some bugs
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    Header append Vary User-Agent

    # 480 weeks
    <FilesMatch “\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”>
    Header set Cache-Control “max-age=290304000, public”
    </FilesMatch>

    # 2 DAYS
    <FilesMatch “\.(xml|txt)$”>
    Header set Cache-Control “max-age=172800, public, must-revalidate”
    </FilesMatch>

    # 2 HOURS
    <FilesMatch “\.(html|htm)$”>
    Header set Cache-Control “max-age=7200, must-revalidate”
    </FilesMatch>

    You have both a CNAME and an A record for wildcard subdomains? I think you only need one or the other, but I’m not sure if that would cause your issue. Try remove one, let the DNS propogate, and check it again.

    2) Set the Domain wildcard subdomains in Apache (in /var/www/vhosts/domain.com/conf/)

    Go back up to the httpd.conf file itself and add ’em in there. I’ve had to do that.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot get subdomains to work on my server’ is closed to new replies.