WordPress.org

Forums

Problems with redirects (1 post)

  1. piemanji
    Member
    Posted 2 years ago #

    I'm having some trouble with rewrites in WordPress, and hoping someone can help me. Basically I would like the post which is currently accessed at http://www.mywpsite.com/post-title to instead be accessed at http://www.mywpsite.com/my-subdirectory/post-title.

    I have been able to make it so that /my-subdirectory/post-title redirects to /post-title, but I want the URL to show as /my-subdirectory/post-title instead.

    My .htaccess currently looks like this:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule my-subdirectory/post-title index.php?page_id=4159 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    I did try this:
    RewriteRule my-subdirectory/post-title post-title [L]

    But that doesn't seem to work at all. Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic