Viewing 3 replies - 1 through 3 (of 3 total)
  • I am not aware of any plugin capable of “moving WordPress”, and here is how I would do what you want:

    ## from https://my.bluehost.com/cgi/help/347#redirect
    # .htaccess main domain to subdirectory redirect
    # Do not change this line.
    RewriteEngine on
    # Change example.com to be your main domain.
    RewriteCond %{HTTP_HOST} ^(www.)?example.com$
    # Change 'subdirectory' to be the directory you will use for your main domain.
    RewriteCond %{REQUEST_URI} !^/subdirectory/
    # Don't change the following two lines.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    # Change 'subdirectory' to be the directory you will use for your main domain.
    RewriteRule ^(.*)$ /subdirectory/$1
    # Change example.com to be your main domain again.
    # Change 'subdirectory' to be the directory you will use for your main domain
    # followed by / then the main file for your site, index.php, index.html, etc.
    RewriteCond %{HTTP_HOST} ^(www.)?example.com$
    #RewriteRule ^(/)?$ subdirectory/index.html [L]
    ## index.php for WordPress
    RewriteRule ^(/)?$ subdirectory/index.php [L]

    The above is self-explanatory as far as edits are concerned, so have it ready and then put it in place as .htaccess in your public “root” directory (folder) immediately after removing ‘/blog’ from both boxes at Settings > General and then all should be well at ‘https://www.mywebsite.com/’.

    Thread Starter James

    (@kevin88)

    Thanks for that.

    Is there any simple instructions on how to do this? I’m not a coder and I think I’d make a lot of mistakes without readable instructions.

    You would first need a plain-text editor capable of saving a file with .htaccess as its extension and no actual filename. Notepad++ is what I use: https://notepad-plus-plus.org/

    In the code I have posted, you would use Ctrl-H to hunt-and-replace all instances of example.com with your own domain, and you would do the same with subdirectory to blog if that is where your installation is actually located. Then at that point, you would save the edited code as .htaccess and have it handy for upload to your public “root” folder where your domain lands and gets further direction before ever going to ‘https://www.mywebsite.com/blog’.

    With the above ready to go, you would go to Settings > General and change ‘https://www.mywebsite.com/blog’ to ‘https://www.mywebsite.com’ in both boxes, then use cPanel > File Manager or an FTP/SFTP connection to place your new .htaccess file in place and you will be done.

    If you are wary of doing that yourself, a Support Tech at your host might be willing to take a look at this thread and do that for you unless you might prefer to find help outside of these forums or ever hire someone to do the work.

    Following the above, your database *might* need a little more updating via cPanel > phpMyAdmin and you *might* have a plugin (such as BulletProof Security) that might (but I doubt) need to be uninstalled and re-installed so can it re-establish its recognition and use of the changed URL and ‘absolute server path’.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to move my wordpress website from sub folder’ is closed to new replies.