I've a problem in my Wordpress website which is after I login from /wp-admin I didn't redirected to anywhere just keep seeing the login page without any errors.

it was working fine when the site was on the root directory but now it stopped working.

I used the .htaccess found here https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/my_subdir/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /my_subdir/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ my_subdir/index.php [L] 

but it still no redirecting to the dashboard.

any help will be appreciated.

  • I assume you also have a copy of index.php (from WordPress root) in the new root together with your .htaccess file, which which has as last line require( dirname( __FILE__ ) . '/my_subdir/wp-blog-header.php' );. You could also add in wp-config.php 2 lines: define('WP_HOME', 'http://example.com'); and define('WP_SITEURL', 'http://example.com/my_subdir'); as extra maybe that helps also. If that works all together please don't forget to go to *Settings/Permalinks (in admin panel) and click Save Changes. – Charles Jan 28 '19 at 10:07
  • Unfortunately this doesn't work for me – Peter Wilson Jan 29 '19 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.