Group Admins

  • Profile picture of Steve

WordPress Troubleshooting and Support

Public Group active 3 months, 2 weeks ago ago

WordPress support from our community

Best Redirect approach when moving from subdirectory to root

Tagged: 

This topic contains 0 replies, has 2 voices, and was last updated by  Susan Rodriguez 6 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1534

    Susan Rodriguez
    Participant

    I am about to move a wp site from a subdirectory to root, and want to have all the old permalinks redirected to the new permalinks at root.
    mysite.com/wp/post-name-here to mysite/post-name-here.

    In the current sub-directory can I add a simple redirect with wildcard in the htaccess or should I use the redirection plugin in the new blog location ?

    If I go redirection plugin route: so far the info I am finding all seem to suggest I need to upload a csv list of all the old permalinks and the new permalinks.
    Is there a way to add a wildcard to redirect all the old permalinks with mysite.com/wp/* to the new permalink structure mysite/* or an alternative approach?

    Thanks in advance

    #2661

    Steve
    Keymaster

    If you are comfortable editing .htaccess, then why use a plugin?

    #2662

    Susan Rodriguez
    Participant

    I am not 100% comfortable with the redirect rules /syntax for htaccess particularly with wordpress’s redirect in the mix. My current quick tests weren’t successfull.

    My question should have been If there is snippet someone has for htaccess that redirects all wp subdirectory permalinks that would be great.

    #2663

    Steve
    Keymaster

    @Susan– Try this. No promises… no return policy even with receipt:

    RedirectMatch 301 ^/wp/(.*) http://mysite.com/$1

    #2664

    Susan Rodriguez
    Participant

    🙂 Thanks Steve. I will try it

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.