Support » Plugin: Redirection » 301 Redirection WordPress plugin redirecting all posts (inc WordPress login page

  • Resolved nanotube

    (@nanotube)


    Hello, I am just wondering if anyone can help me with this issue.
    I have setup the redirection WordPress plug-in so all posts on a WordPress site can be redirected to an external site, however the redirection plug-in is referring the WordPress admin login page to the destination site too, so I cant log back in to WordPress once this redirection is set.

    I know I can remove the redirection plug-in from my web host to get back in but I need to know how to make the wp-admin and wp-login.php pages so they are not effected by the 301 redirection.

    The 301 redirection plugin I am using is
    https://en-gb.wordpress.org/plugins/redirection/

    Here is how I setup the redirection plug-in

    source: ^/(.*)
    Output: http://exampledestinationsite.com

    with regex ticked on the source

    Any help would be much appreciated
    Thank you
    Keith

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • CEMBTW

    (@cembtw)

    You could use a negative lookahead (look under “Group Constructs here). I don’t know if this is the best way, but:
    ^\/((?!wp-admin).)*$
    will match:

    /example.com
    /example.com/
    /example.com/my-page
    /example.com/my-page?id=1

    and fail to match:
    /example.com/wp-admin/
    This assumes that “wp-admin” is at the beginning of the URLs you want leave un-redirected.

    • This reply was modified 2 years ago by CEMBTW.

    I also encountered this issue. I think the plugin should allow to include an option to determine if the login page should be treated as part of the admin pages (thus being excluded)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘301 Redirection WordPress plugin redirecting all posts (inc WordPress login page’ is closed to new replies.