Wp-admin Redirection loop after moving to subdirectory

I've moved my Wordpress files from public_html to a subdirectory public_hmtl/my-site.com. I've changed my .htaccess in the public_html directory by

RewriteEngine on RewriteCond %{HTTP_HOST} ^my-site.com$ [NC,OR] 
RewriteCond %{HTTP_HOST} ^www.my-site.com$ 
RewriteCond %{REQUEST_URI} !my-site.com/
RewriteRule (.*) /my-site.com/$1 [L]

I've configured my database and wp-config.php too, to:

define('WP_HOME','https://www.my-site.com');
define('WP_SITEURL','https://www.my-site.com');
define('RELOCATE',true);

But when I want to login per wp-admin the path seems to be like:

wp-login.php?redirect_to=https%3A%2F%2Fwww.my-site.com%2Fmy-site.com%2Fwp-admin%2Freauth=1

Do you have any idea?

Thanks

Kamil

Topic redirect wp-admin Wordpress

Category Web


try this >>

step 1) on wp-config.php

define('WP_HOME','https://www.my-site.com/my-site.com');
define('WP_SITEURL','https://www.my-site.com');
define('RELOCATE',true);

now, on your /index.php change this line: require( dirname( FILE ) . '/wp-blog-header.php' ); to

require( dirname( __FILE__ ) . '/my-site.com/wp-blog-header.php' );

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.