• jwpettit

    (@jwpettit)


    I have a basic understanding of htaccess, but not enough to figure out the right way to do this (i hacked it to get it to work, but not the way i wanted, so i’m asking for some help!). I think in this case i really need someone who understands the permalink rewrites and htaccess.

    WordPress used to be installed at https://myweb.com/wordpress/
    I moved the index.php file to my root so it’s now https://myweb.com/

    The problem is with the permalinks that others have bookmarked and that have been crawled by search engines.

    Old rewrite:
    RewriteRule ^wordpress/archives/category/(.+)/page/?([0-9]{1,})/?$ /index.php?category_name=$1&paged=$2 [QSA,L]
    New rewrite:
    RewriteRule ^archives/category/(.+)/page/?([0-9]{1,})/?$ /index.php?category_name=$1&paged=$2 [QSA,L]

    How can i write a redirect that will redirect those going to (for example):
    https://myweb.com/wordpress/archives/2005/02/02/test
    to:
    https://myweb.com/archives/2005/02/02/test
    ???

    I thought about:
    RewriteRule ^wordpress/archives/category/(.+)/page/?([0-9]{1,})/?$ /archives/category/(.+)/page/?([0-9]{1,})/?$ [QSA,L]

    Also, if this makes sense, how do i indicate the move is permanent (ie 301)?
    Thanks for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • jpettit

    (@jpettit)

    anyone want to take a stab at this for me? ??

    me too?

    Brief rundown. Permalinks and site were accessed via
    yoursite.com/wordpress/ and yoursite.com/wordpress/archives/etc/

    and you now want it to be accessed via
    yoursite.com/ and
    yoursite.com/archives/etc/

    where is your .htaccess file located? is it in the root (/) or is it in /wordpress/ ?

    If its in the root, the top of the wordpress rules should say something like rewritebase wordpress/ change it so it looks like rewritebase /

    If its in /wordpress/ move it to the root and update accordingly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘htaccess redirects after moving worpress directory’ is closed to new replies.