• Hi,

    I developed a WordPress site in a subdomain and, following instructions from my hosting company on how to make the site live, I copied the wp directory into the public_html file and updated the site settings to reflect the live site url.

    Now trying to hit the site pulls up a page that doesn’t have the styles attached, but some element are correct: https://joycastro.com/wp/
    The navigation list is correct, but it isn’t formatted correctly. So it’s finding some elements of the site.

    If I try to log into the WordPress admin, I get an error message: can’t find wp-login. But when I FTP to the directory, it’s there.

    Thanks in advance. Any help would be greatly appreciated.

    James

Viewing 3 replies - 1 through 3 (of 3 total)
  • I copied the wp directory into the public_html file and updated the site settings…

    …the site pulls up a page that doesn’t have the styles attached…

    I think that means WordPress is finding the database for content and menus but it is not finding your theme.

    If I try to log into the WordPress admin, I get an error message: can’t find wp-login.

    With ‘ RewriteBase /wp/ ‘ and the lower line showing the same being the keys, this might fix both issues:

    @ https://joycastro.com/wp/.htaccess

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wp/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp/index.php [L]
    </IfModule>
    # END WordPress

    If not, try searching your database for *exact matches* of https://joycastro.com and https://joycastro.com/ to see whether either might still be there without being https://joycastro.com/wp . If so, this might take care of that:

    cPanel > phpMyAdmin SQL

    note: Edit ‘pref’ (the table prefix in three places below) to your own value (as in $table_prefix = '???_'; in wp-config.php), and then change ‘https://www.olddomain.com&#8217; and ‘https://www.newdomain.com&#8217; as required (three places each and with no trailing slashes)

    UPDATE pref_options SET option_value = replace(option_value, 'https://www.olddomain.com', 'https://www.newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE pref_posts SET guid = replace(guid, 'https://www.olddomain.com', 'https://www.newdomain.com');
    UPDATE pref_posts SET post_content = replace(post_content, 'https://www.olddomain.com', 'https://www.newdomain.com');

    If not, you might have a theme or plugin using “absolute server path” and will need to be deactivated, uninstalled and re-installed so it can update its own path.

    Thread Starter JMickeyD

    (@jmickeyd)

    Thanks very much for your reply. This is a little over my head. Can you clarify what you mean by:

    With ‘ RewriteBase /wp/ ‘ and the lower line showing the same being the keys, this might fix both issues:

    @ https://joycastro.com/wp/.htaccess

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wp/
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp/index.php [L]
    </IfModule>
    # END WordPress

    At your server you have a public “root” folder that might be named /public_html/ or /htdocs/ or whatever name the system at your host uses, and that is where a Primary Domain is typically located. For a WordPress installation in that location, the two relevant lines would be like this:

    RewriteBase /
    
    RewriteRule . /index.php [L]

    Your sub-domain installation is in a sub-folder of your public “root”, so its own httaccess needs that different path:

    RewriteBase /wp/
    
    RewriteRule . /wp/index.php [L]

    So overall, you have this:

    public_root/.htaccess and Primary Domain
    public_root/wp/.htaccess and sub-domain installation

    And then at that point, each installation is independent of the other — each has its own completely-unique set of files — and does not even know the other exists.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Install from subdomain’ is closed to new replies.