Forums

Advanced mod_rewrite + permalink preservation (3 posts)

  1. eston
    Member
    Posted 5 years ago #

    I'm moving my blog to a new server, and I've decided to pull it out of its /blog/ directory to the root.

    In doing so, however, I'm going to lose all of my permalinks (and with it a ton of people who have linked to that structure. Everything after /blog/ is staying the same; so I attempted a rewriterule as such:

    RewriteRule ^/blog/(.*)$ /$1 [L]

    But it doesn't solve the issue since the original wordpress permalink structure is most likely interfering with it. What do I need to do in .htaccess to get my permalinks working while moving my blog software down one directory?

  2. Otto
    Tech Ninja
    Posted 5 years ago #

    Try RewriteRule ^/blog/(.*)$ /$1 [R,L] and make sure that you put it in the .htaccess above the WordPress rules, not after them. Rules are processed top to bottom, obviously.

  3. eston
    Member
    Posted 5 years ago #

    Nope, that doesn't seem to work either. I just get a 404 page.

Topic Closed

This topic has been closed to new replies.

About this Topic