• Hi,

    I’ve got a problem. I’d like to run WordPress on a Subdomain.

    My website is for example: http://www.MY123SITE.com
    I’ve created a Subdomain: http://upgrade.MY123SITE.com

    So, what I’ve done:
    a) I’ve created a folder web within the subdomain name directory ‘upgrade’ and then move all the content into the folder titled ‘web’.
    ftp:/subdomains/upgrade/web/all Files…
    /wp-admin
    /wp-content
    /wp-includes
    wp-config.php

    b) I’ve updated my WordPress config file to reflect the new database, “wp-config.php from ftp:/subdomains/upgrade/web/wp-config.php
    c) I’ve updated “wp_options” -> siteurl from http://www.MY123SITE.com/MY123SITE to http://upgrade.MY123SITE.com

    Unfortunately, If I’m checking on my web browser an address http://upgrade.MY123SITE.com I will redirect to http://www.MY123SITE.com/

    Please let me know what it’s wrong?
    If I need to change something else?
    How can I log in to WordPress Panel for this Subdomain?

    It’s not a DNS propagation because I waited for 24h.

Viewing 5 replies - 1 through 5 (of 5 total)
  • There are a few things that are causing the issue.

    1. You mentioned that you moved everything into a folder “web” but your subdomain is “upgrade”. Files should all be in root folder “upgrade”
    2. Did you change all of the urls in the database?
    3. Did you duplicate the old database and rename it or just create a new empty database?
    4. The redirect is probably due to the .htaccess file

    Your best bet for moving wordpress is to use a backup/restore plugin.
    BackupWP
    or my favorite Akeeba backup and kickstart
    These plugins will compress the entire site and database into a file that you can then move anywhere. Akeeba Backup with kickstart will even fix all the urls in the database upon restore.

    If you would like to do it manually you can do that as well. Check here for instructions https://codex.wordpress.org/Moving_WordPress

    You will also need a database search/replace utility like this one to change any urls in the DB
    https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    Thread Starter amigo2017

    (@amigo2017)

    Hi,
    Thank for the response.
    So,
    1) Right, I’ve copied all WordPress files to ftp:/subdomains/upgrade/
    2) No, I’ve changed only “wp_options” -> siteurl from http://www.MY123SITE.com/MY123SITE to http://upgrade.MY123SITE.com in phpMyAdmin.
    I’ve not changed all urls for example in: wp_posts, wp_postmeta . Should I change now?
    3)At the beginning, I added an empty new database on my host service. My new database is ‘dcustomer_upgrade’.
    After that, I imported File.sql with all information from an original database by phpMyAdmin. I can connect to ‘dcustomer_upgrade’ database and execute queries if I want.
    I changed wp-config as well:
    define(‘DB_NAME’, ‘dcustomer_upgrade’);
    define(‘DB_USER’, ‘********’);
    define(‘DB_PASSWORD’, ‘*******’);
    define(‘DB_HOST’, ‘mysql..’);

    4. .htaccess file
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?http://upgrade.MY123SITE.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

    I am still redirecting to MY123SITE.com

    Run SearchReplaceDb3 to make sure the url is changed in the DB.

    Or as I stated, start over with Akeeba takes 5 min to move a WP site and the longest part is the FTP

    Thread Starter amigo2017

    (@amigo2017)

    Hi,

    I’d like to ask about one thing. I’ve restored WordPress website by akeebabackupwp-2.4.0-core.zip Restored website looks fine but if I try to login to WordPress Control Panel I will redirect to the original website address. Can you give me an idea why and where can I change this?

    For example:

    Restored website has address http://123.xyz.com/wp-login.php

    When I click log in I will redirect to http://original.com/original/wp-login.php

    The last step in the restore process changes all the URLs in the site. Make sure all of the browser’s cache has been cleared by pressing ctrl f5 a few times.
    also check the .htaccess file

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Run copy of oryginal WordPress on Subdomain’ is closed to new replies.