The MU forums have moved to WordPress.org

Cannot get Sub Domains to work on 3.0 (11 posts)

  1. hauruapai
    Member
    Posted 4 years ago #

    Hi,

    I have done a clean install of the WP 3.0 on a new domain, choose sub domain, followed the wildcard dns instructions, have the super admin, made the changes to the wp-config.php and the .htaccess file as shown during setup.

    I am sure that the sub domains are working because no matter what I type as a subdomain, I do get a page and not a 404 error - but unfortunately a default cgi-sys page shows, and not a WP blog.

    My main domain wp works fine.

    In my Super admin I get for Backend for the sub domains I get subdomain.mydomain.com/wp-admin/ and visiting there gives a 404 error page.

    I also added ServerAlias: *.yourdomain.com yourdomain.com to my httpd.conf file when looking around for things to try to get it working and also made sure that AllowOverride FileInfo Options was set for the directories in the httpd.conf file.

    Any advise and ideas on how to get this to work will be really appreciated :D

    Thank you for your time. :)

  2. shapipo
    Member
    Posted 4 years ago #

    make sure you put ServerAlias before Servername and under DocumentRoot

    make sure *.your-domain.ltd is resolving to the servers ip address.

    and when you set the address for the main blog, make sure you set your-domain.ltd without the www.

  3. hauruapai
    Member
    Posted 4 years ago #

    Thank you for your help. I have checked all and they are as you say they should be.

    make sure *.your-domain.ltd is resolving to the servers ip address.
    - Did a ping of the your-domain.ltd for the IP then a ping for XXX.your-domain.ltd and both are the same

    and when you set the address for the main blog, make sure you set your-domain.ltd without the www.
    In my WP Superadmin the domain for the main one is your-domain.ltd

    ----------------------
    However, I am not too sure where to do this one:
    make sure you put ServerAlias before Servername and under DocumentRoot but this is what my httpd.conf file has

    <Directory "/">
    Options All
    AllowOverride All
    </Directory>

    <Directory "/usr/local/apache/htdocs">
    Options Includes Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all

    </Directory>
    ---------------------------

    This is my .httpaccess file in the root of your-domain.ltd - it is exactly what is says in the Network page

    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]

    There must be something else that I am missing as it is still doing the same thing:

    Will pull up some default page for *.your-domain.ltd and not the WP page

    XXX.your-domain.ltd/wp-admin (when XXX is in the super admin) will spit a .404

    Any other guidance will be MOST appreciated :D

    Once again, thank you for your time

  4. donalyza
    Member
    Posted 4 years ago #

    I'm also getting the same problem, thought the difference is I'm not getting error 404. All I got is failed to open page.

    Here's my site: http://donalyza.com, I'm using WordPress 3.0-RC2-15161

    Here's what I did. I created a wildcard http://*.donalyza.com/public_html then I configured wp-config to allow multisite. followed the steps given in Network, put the code in wp-config and htaccess. Then I created a site, in SuperAdmin, "demo".

    That's where my problem begins, I pulled-up http://demo.donalyza.com and all I got i page cannot be displayed. :(

    Here's what I have in my /public_html/.htaccess

    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </IfModule>
    
    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]
    
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.donalyza\.com$ [NC]
    RewriteRule ^(.*)$ http://donalyza.com/$1 [R=301,L]

    I tried to follow hauruapai to put a code in httpd.conf
    I included this code though I'm not sure if i place it on the right path..

    path: /httpd.conf/public_html

    AllowOverride FileInfo Options
    
    <Directory "/">
    Options All
    AllowOverride All
    </Directory>
    
    <Directory "/usr/local/apache/htdocs">
    Options Includes Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    
    </Directory>

    Inside my directory I have a "demo" folder,
    path: /public_html/demo/

    inside the folder is another .htaccess and an empty cgi-bin folder

    inside .htaccess

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^demo.donalyza.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.demo.donalyza.com$
    RewriteRule ^/?$ "http\:\/\/donalyza\.com\/demo" [R=301,L]

    I don't know what else to do.

    Thank you for reading my post, Any help will greatly be appreciated.

  5. donalyza
    Member
    Posted 4 years ago #

    I was able to fix it!!!

    Since I've been exhausted almost the entire day figuring this out I took a break and watched DVD. After the movie, I thought I give up but then again the urge of wanting to fix the problem made me decide to find the resolution. In just a few minutes sitting... I went back to my admin page, then click permalinks. I chose the first option and tested the site. I was amaze coz it pulled up the page. Then I went back to undo my changes and it seems everything is on its place. Good job to me.. Hehe..

    @hauruapai: you may want to try that, it worked for me. I hope you fix yours too..

  6. hauruapai
    Member
    Posted 4 years ago #

    Thank you for your information donalyza - it is much appreciated :D

    I saw when I looked at your .htaccess that you had re-write lines for www or not www so I added those to mine - I can put in http://www.mydomain.com and it will re-direct it to mydomain.com so at least I now know that the .htaccess file is being read.

    I also tried to create the sub directory called demo and drop a .htaccess into it as I did not have the sub directory but that still did not work.

    Then I tried the permalink idea that worked for you. Unfortunately still no luck :(

    Am still looking for other ideas but if anyone else has any please chip in - I will try anything to get this to work!

  7. andrea_r
    Moderator
    Posted 4 years ago #

    @hauruapai - in the Apache httpd.conf file, you absolutely need a wildcard record in there too. What you have above doesn't have it. Look for the ServerAlias line with your domain name.

    ServerAlias yourdomain.com *.yourdomain.com

    This is what it needs to look like.

  8. hauruapai
    Member
    Posted 4 years ago #

    Thank you soo much andrea_r for your input!

    I thought I had done that but when I checked again it I had not saved the changes *sheepish grin* but now that I have saved the changes (and made sure they were saved) it works :D

  9. hauruapai
    Member
    Posted 4 years ago #

    *groan*

    Today I decided to add another sub domain .....

    and the new subdomain site is not showing up - it is doing what the first subdomain that I set up was doing before ...

    I checked the httpd.conf and the ServerAlias *.yourdomain.com bit had disappeared .. so I added it in again and still not working ....

    I am now using WordPress 3.0-RC3-15257

    My first sub domain that I set up is still working fine, it is just this one that I have added that is the problem now.

    Any ideas would be most appreciated :D

  10. andrea_r
    Moderator
    Posted 4 years ago #

    The wordPress version absolutely does not matter. this is server tech. :)

    I checked the httpd.conf and the ServerAlias *.yourdomain.com bit had disappeared ..

    If it's apache2 you have to put it in the include files for that vhost so it doesn't get overwritten. Don't forget to restart apache either.

  11. hauruapai
    Member
    Posted 4 years ago #

    Thank you soo much andrea_r - I put the ServerAlias into the include files (http://www.nerdydork.com/setting-up-wildcard-dns-subdomains-on-cpanel.html is the instructions including restarting apache that I followed in case anyone else is looking for a howto on this) and it now works like a charm :D

    I even created a new sub domain and that went live too straight away!

    Once again, thank you for your help - it is very much appreciated :D

About this Topic

  • Started 4 years ago by hauruapai
  • Latest reply from hauruapai