Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello, the below link explains how to properly move websites within WP.

    https://codex.www.ads-software.com/Moving_WordPress#Moving_WordPress_Within_Your_Site

    Make sure you have done everything as it’s explained there, if you are still experiencing issues let me know.

    Davor

    (@davoraltman)

    Try renaming the .htaccess file first. That should allow you to log into the wp-admin and afterwards, just save the permalinks to generate new .htaccess.

    Thread Starter DLJones

    (@dljones)

    Hi David and Davor, thanks so much for your responses! I have reviewed the instructions for properly moving a WordPress website within my own site and I followed them correctly.

    I have renamed the .htaccess file but I still cannot get to the login page.

    When I try to access these links, I get redirected to a page with the following error. Even though I can verify that these files are indeed sitting on the server where they should be:

    These links:
    https://www.cmacinc.ca/wp-login.php
    https://www.cmacinc.ca/wp-admin

    Redirect to:
    https://www.cmacinc.ca/not_found
    “Not Found
    The requested URL /not_found was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.”

    Can you post your .htaccess file so that I may see if there is anything causing the issue?

    Thread Starter DLJones

    (@dljones)

    Hi David, I renamed the .htaccess file so it is not longer in play. So, is what is inside it relevant? Here is what it contained. Is it possible for an .htaccess file to “cache” at the server level so it is in play even though I renamed it?

    # BEGIN iThemes Security
    # BEGIN Hide Backend
    # Rules to hide the dashboard
    RewriteRule ^(/newsite/)?isoexpertin/?$ /newsite/wp-login.php [QSA,L]

    # END Hide Backend
    # BEGIN Tweaks
    # Rules to block access to WordPress specific files
    <files .htaccess>
    Order allow,deny
    Deny from all
    </files>
    <files readme.html>
    Order allow,deny
    Deny from all
    </files>
    <files readme.txt>
    Order allow,deny
    Deny from all
    </files>
    <files install.php>
    Order allow,deny
    Deny from all
    </files>
    <files wp-config.php>
    Order allow,deny
    Deny from all
    </files>

    # Rules to disable directory browsing
    Options -Indexes

    <IfModule mod_rewrite.c>
    RewriteEngine On

    # Rules to protect wp-includes
    RewriteRule ^wp-admin/includes/ – [F]
    RewriteRule !^wp-includes/ – [S=3]
    RewriteCond %{SCRIPT_FILENAME} !^(.*)wp-includes/ms-files.php
    RewriteRule ^wp-includes/[^/]+\.php$ – [F]
    RewriteRule ^wp-includes/js/tinymce/langs/.+\.php – [F]
    RewriteRule ^wp-includes/theme-compat/ – [F]

    # Rules to prevent php execution in uploads
    RewriteRule ^(.*)/uploads/(.*).php(.?) – [F]

    # Rules to block unneeded HTTP methods
    RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK) [NC]
    RewriteRule ^(.*)$ – [F]

    # Rules to block suspicious URIs
    RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR]
    RewriteCond %{QUERY_STRING} ^.*\.(bash|git|hg|log|svn|swp|cvs) [NC,OR]
    RewriteCond %{QUERY_STRING} etc/passwd [NC,OR]
    RewriteCond %{QUERY_STRING} boot\.ini [NC,OR]
    RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
    RewriteCond %{QUERY_STRING} http\: [NC,OR]
    RewriteCond %{QUERY_STRING} https\: [NC,OR]
    RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [NC,OR]
    RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
    RewriteCond %{QUERY_STRING} ^.*(%24&x).* [NC,OR]
    RewriteCond %{QUERY_STRING} ^.*(127\.0).* [NC,OR]
    RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR]
    RewriteCond %{QUERY_STRING} ^.*(request|concat|insert|union|declare).* [NC]
    RewriteCond %{QUERY_STRING} !^loggedout=true
    RewriteCond %{QUERY_STRING} !^action=jetpack-sso
    RewriteCond %{QUERY_STRING} !^action=rp
    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
    RewriteCond %{HTTP_REFERER} !^https://maps\.googleapis\.com(.*)$
    RewriteRule ^(.*)$ – [F]
    </IfModule>
    # END Tweaks
    # END iThemes Security
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /newsite/
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /newsite/index.php [L]
    </IfModule>

    # END WordPress

    I just wanted to see that there was no issue within htaccess, and at first glance there is not.

    You can also try reading these instructions here at this link to see if any of the steps provide you with a solution to access your login page.

    https://codex.www.ads-software.com/Giving_WordPress_Its_Own_Directory

    Thread Starter DLJones

    (@dljones)

    David and Davor, thank you so much for your help and considerate suggestions. I am embarrassed to tell you the issue…but at least it is resolved. When I moved the site, somehow the .htaccess file was renamed without the period…and I didn’t notice it was missing until a moment ago. Period put back, login page magically appears. Sigh, that was a lot of stress for such a little punctuation mark. I’m so sorry to have used your time. I really appreciated it!
    Deb

    Not an issue, I’m very glad I can help.

    Happens to everyone!

    Davor

    (@davoraltman)

    No problem, Deb ?? It happens.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘moved site from sub-directory to root, urls not working’ is closed to new replies.