A
A
ALEX nerd2020-05-22 01:50:40
WordPress
ALEX nerd, 2020-05-22 01:50:40

What should I do if the site redirect does not work?

After logging into the account, the user enters the "my account" section, although earlier the user got to the main page, and when clicking on the name of the site, the user should get to the main page, but he is again thrown to the account page.
How to make it so that after logging in the user gets to the main page?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Ataykin, 2020-05-22
@pavel_ataykin

Add this code to functions.php. It will replace the standard redirect with the one you need. For the main it is "/".

add_filter('login_redirect', 'loginRedirect');

function loginRedirect() {
   return 'http://example.com';
}

Q
QuestYouCraft, 2020-05-23
@QuestYouCraft

It started after installing 1 plugin, but when I removed it, everything remained the same

So you need to delve into the database and FTP and remove the traces of the plugin. Even easier is to backup and reinstall WordPress or set the appropriate rule in .htaccess

A
ALEX nerd, 2020-05-23
@Fhvfvh

Ok, I figured it out, it was that there were a lot of redirects on the site, I asked technical support to set up a 301 redirect, now everything is ok

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question