• Resolved thebourboncowboy

    (@thebourboncowboy)


    I have long loved this plugin, but am being forced to leave wordpress. For the next month I’d like to continue using this plugin to redirect all our content but still get access to wp-admin. I know John has the handy-dandy full site redirect in the options, but I can’t use that because our content is being redirected differently depending on the type. Is there any cool regex trick I could pull of to keep wp-admin access? these are my 3 redirect rules:
    ^/$
    https://www.mynewdomain
    this should direct anyone who tries to go to our home page to the new home page.

    ^/(\d{4})/(.*)
    https://www.mynewdomain/$2
    This redirects all of our POSTS to the new correct location (basically stripping the year out of the permalink)

    ^/(.*)
    https://www.mynewdomain/$1
    This redirects all of our PAGES and other non-post urls… but as you know it also immediately prevents me from logging into the backend of wordpress.

    any tricks up your sleeve?

Viewing 1 replies (of 1 total)
  • Plugin Author John Godley

    (@johnny5)

    It’s better to use / for the root of your site rather than a regular expression ^/$

    any tricks up your sleeve?

    Your expression is matching every page, so it will do exactly as told. You can either modify the expression to exclude certain pages, modify the expression to be more specific (i.e. only match the other URLs), or try and use a ‘do nothing’ action for the URLs you want to exclude.

    https://redirection.me/support/redirect-actions/

Viewing 1 replies (of 1 total)
  • The topic ‘Redirect entire site except allow wp-admin’ is closed to new replies.