Forums

[resolved] moved to a new folder, would like to add a redirect (2 posts)

  1. scormeny
    Member
    Posted 5 years ago #

    Hi, I moved my installation of wordpress from
    http://www.domain.org/wp/ to
    http://www.domain.org/

    I would like to add some kind of redirect rule so that if there are errant links out there in the world on other sites, their links to anything in that "wp" folder, will continue to work because a link to

    http://www.domain.org/wp/foobar.pdf , for example, would redirect to

    http://www.domain.org/foobar.pdf .

    If foobar.pdf doesn't exist, then the 404 error could be displayed, but if it does exist, I'd like users not to have to hunt it down!

    Thanks for advice. I am on an apache server, and I can edit htaccess. I think I want to add a line to htaccess, but I have tried a couple of times based on random advice I've found online related to RewriteRule, without success.

    Many thanks for responses!

  2. scormeny
    Member
    Posted 5 years ago #

    Okay, I have found the solution. The final post in this thread, http://wordpress.org/support/topic/74775, has a link to digitalpoint forums that gave me a clear answer I could use.

    In the instance I've outlined above, I would add a line to my htaccss file after the line that says


    RewriteBase/

    saying:


    RewriteRule ^wp/(.*)$ http://www.domain.org/$1 [R=301,L]

    Hope that helps someone else too!

Topic Closed

This topic has been closed to new replies.

About this Topic