WordPress.org

Ready to get started?Download WordPress

Forums

301 Redirect When WP Is In Sub-Directory (1 post)

  1. rerartist
    Member
    Posted 1 year ago #

    Hi
    I've searched through 301 Redirect threads, but no luck.
    My question is about htaccess 301 redirect when the WordPress files are in a sub-directory. (old site pages are .html)

    1. WordPress isn't "live" yet, so for development purposes, WordPress URL and Site URL are both currently set to http://DomainName.com/WP_SubDir

    2. Permalinks are set to Post Name:
    http://DomainName.com/WP_SubDir/sample-post/

    3. When it's time to go live, I already know how to copy over index.php and move wp-config.php, etc., then change the Site URL in General Settings, so that's not an issue.

    QUESTION:
    Assuming that Site URL will be http://DomainName.com, what is the correct method?

    Redirect 301 /old.html http://DomainName.com/NewPage.php

    OR

    Redirect 301 /old.html http://DomainName.com/WP_SubDir/NewPage.php

    Thanks in advance for any pointers.

Topic Closed

This topic has been closed to new replies.

About this Topic