• Resolved IanWaring

    (@ianwaring)


    I’ve set up a site using 3.5 under a .com domain name, which worked fine. Then I tried to get Multisite installed which I managed to bodge then correct. The state now is that Multisite is running fine, but the site name in wp-config is my sites IP address, as it is in MySQL WordPress database wp_options as the siteurl and home.

    If I enter the domain name in a browser, I get my main site up – but it changes the URL displayed to the IP address. I can only access /wp-admin if I tap this in after the IP address, not the domain name. Finally, if I go to create a new site in my network, it suggests the domain will be referenced as the x.x.x.x/sitename, not https://www.mydomain.com/sitename as I intended.

    I really want https://www.mydomain.com as my main site, and any in my network as https://www.mydomain.com/subsitename. Likewise to access my Admin page off the main site URL. In time, there will by 100s of these sub sites, primarily accessed by their own domain names.

    Besides changing the site fields in wp_options, and changing the site name in wp_config.php, are there any other places I need to change things to make this work? It looks like I need to change it in MySQL table wp_host as well, but I’m getting deeper and I suspect walking into trouble!

    Any pointers or guidance greatly appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter IanWaring

    (@ianwaring)

    In case it helps, /home/wordpress/public_html/wp-config.php includes:

    /* MultiSite */
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    /*$base = '/';*/
    define('DOMAIN_CURRENT_SITE', '37.139.31.149');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    
    /* Force SSL connectionss to the WordPress Dashboards */
    /*define('FORCE_SSL_ADMIN', true);*/
    
    /* That's all, stop editing! Happy blogging. */

    /home/wordpress/public_html/.htaccess contains:

    # Disable directory browsing
    #Options All -Indexes
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    and /etc/apache2/sites-enabled/software-enabled.com contains:

    <VirtualHost *:80>
    
      ServerAdmin [email protected]
    
      DocumentRoot /home/wordpress/public_html
    
      Servername software-enabled.com
    
      ServerAlias www.software-enabled.com
    
    </VirtualHost>
    
    <VirtualHost *:80>
    
      ServerAdmin [email protected]
    
      DocumentRoot /home/wordpress/public_html
    
      Servername 37.139.31.149
    
    </VirtualHost>
    Thread Starter IanWaring

    (@ianwaring)

    Nearly there.

    Changed wp-config.php:

    define('DOMAIN_CURRENT_SITE', '37.139.31.149');
    to
    define('DOMAIN_CURRENT_SITE', 'www.software-enabled.com');

    Changed the /etc/apache2/sites-enabled/software-enabled.com VirtualHost to reference a Servername of https://www.software.com only, removed the previous www alias, and knocked out the otherwise identical second VirtualHost definition. Copied the lot into a file in the same directory called https://www.software-enabled.com.

    Finally, in MySQL wordpress database, changed the domain names in wp_options to ‘www.software-enabled.com’ in the siteurl and home records, and changed the only domain name in wp_blogs to ‘www.software-enabled.com’. Changed the domain name in wp_site to https://www.software-enabled.com.

    After the Apache restart, I can now see my main blog okay. However, when I try to get to /wp-admin, it’s generating an error 500 against a URL of:

    https://www.software-enabled.com/wp-admin/www.software-enabled.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.software-enabled.com%2Fwp-admin%2F&reauth=1

    Any ideas what I need to tweak to make wp-admin come up properly?

    Thread Starter IanWaring

    (@ianwaring)

    Hmmm – formatting – the first three mentions of my site missed http and had a slash at the end of the domain definitions!

    Thread Starter IanWaring

    (@ianwaring)

    I can’t see wp-admin from the browser.

    I suspect the fastest way to fix this is to flatten the whole thing and start again. I fear I’m manually hacking this into oblivion :-}

    Thread Starter IanWaring

    (@ianwaring)

    I decided to delete my server and install afresh, this time being careful to get things right first time, obey all instructions to the letter and to be consistent on my https://www.domain.com address throughout.

    Everything is now working like a dream. Main site up, first network site up, and the various wp-admin dashboards working fine. Hence I’ll mark this as resolved ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘IP Address always showing; how do I correct this?’ is closed to new replies.