WordPress.org

Ready to get started?Download WordPress

Forums

How could I make 301 redirection from "wp" folder to the root (my current homepa (9 posts)

  1. samireivinen
    Member
    Posted 2 years ago #

    Hi,

    i have moved succesfully my wordpress from:

    http://www.valokuvaamoklik.fi/wp
    to
    http://www.valokuvaamoklik.fi

    however, some outside links and google, still points to the old folder. The old folder "wp" gives now "page not found". I have tried to change .htaccess file in the root to redirect, but without success. How could I make 301 redirection from "wp" folder to the root (my current homepage)?

    Thanks in advance :)

  2. Threecows
    Member
    Posted 2 years ago #

    Add the following "redirect" code to an empty text file.
    Name it index.html
    Upload it to the "wp" folder (NOT to the root folder!)

    <html>
    <head>
    <meta http-equiv="Refresh" content="0;url=http://www.valokuvaamoklik.fi" />
    </head>
    </html>
  3. samireivinen
    Member
    Posted 2 years ago #

    Hi Threecows,

    thanks for the reply. Do you know, does google accept this as a proper 301 redirection?

  4. samireivinen
    Member
    Posted 2 years ago #

    hi again,

    i tried the code. i needed to remove wordpress created index.php from "wp" folder to get index.html work. Is it ok to remove? In the move I copied index.php from the wordpress folder "wp" to the root. In the instructions it was pointed that one most copy, not move index.php and .htaccess files.

  5. Threecows
    Member
    Posted 2 years ago #

    It is saver not to remove original files.
    You 'd better rename index.php in the "wp" folder to indexOLD.php.
    So you can always get back to the original files if needed.

  6. Threecows
    Member
    Posted 2 years ago #

    I see now it works :).
    If you did remove index.php and/or index.html from the wp-folder: don't worry!
    There is always a way to restore but I do not think that will be necessary.

  7. samireivinen
    Member
    Posted 2 years ago #

    I just renamed index.php, so no problem :)
    Do you know is it proper way for google to do redirecting?

    thanks again!

  8. samireivinen
    Member
    Posted 2 years ago #

    First I thought that this worked out, but now I had to return to starting point. It is not good idea to replace index.php with index.html that has redirection. Reason is that when somebody search, lets say this article:

    http://valokuvaamoklik.fi/wp/2012/02/parempia-kuvia-kevyella-kalustolla/

    it would give an error, because it needs /wp/index.php to redirect articles and pages that are linked under /wp/ folder to the right address. This article for example needs to be redirected here:

    http://valokuvaamoklik.fi/2012/02/parempia-kuvia-kevyella-kalustolla/

    So my old hompage http://www.valokuvaamoklik.fi/wp -rederection needs to be handeled somehow in .htaccess.

    I think this should be rather generic problem, so I think there should be an easy solution for this. PLEASE HELP :)

  9. samireivinen
    Member
    Posted 2 years ago #

    ok, yeah, now I got it. Just installed this free plugin:

    Quick Page/Post Redirect DEV

    and told it to redirect http://www.valokuvaamoklik.fi/wp to http://www.valokuvaamoklik.fi

    and now it works :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags