Can’t login to admin after moving WordPress to its own directory
-
My site keeps getting hacked, so I decided to move WordPress to its own directory so that I can generate and use static pages in the main directory with Simply Static.
I am trying to move WordPress to its own directory, using “Method II” here: https://codex.www.ads-software.com/Giving_WordPress_Its_Own_Directory
Here’s what I did:
1. Create the new location for the core WordPress files to be stored (https://subvariant.com/wordpress/)
2-5. In “wp_options” via PHPMyAdmin I set “home” to “https://subvariant.com”
And “siteurl” to “https://subvariant.com/wordpress”
6. Now move your WordPress core files (from root directory) to the subdirectory (https://subvariant.com/wordpress/).
7. Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site (https://subvariant.com).Here is the .htaccess at https://subvariant.com
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress AddHandler application/x-httpd-php70 .php .php5 .php4 .php3
Here is the .htaccess at https://subvariant.com/wordpress
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress AddHandler application/x-httpd-php70 .php .php5 .php4 .php3
8. Open your root directory’s index.php file in a text editor
9. Change the following and save the file. Change the line that says:
require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
to the following, using your directory name for the WordPress core files:
require( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );
10. Login to the new location: https://subvariant.com/wordpress/wp-admin/And here where it doesn’t work.
The url goes to: https://subvariant.com/wordpress/wp-login.php?redirect_to=https%3A%2F%2Fsubvariant.com%2Fwordpress%2Fwp-admin%2F&reauth=1
The css is not working, and using a correct login doesn’t do anything–it stays on the same page.
The page I need help with: [log in to see the link]
- The topic ‘Can’t login to admin after moving WordPress to its own directory’ is closed to new replies.