WordPress.org

Ready to get started?Download WordPress

Forums

HTACCESS redirecting everything to the right of a folder (4 posts)

  1. wasana
    Member
    Posted 1 year ago #

    I'm migrating an old site to a new setup and using the 'redirection' plugin to 301 old pages/directories to new pages. I tried a regular expression but having some loop issues.

    the old site had a directory - /title/

    I'm trying to redirect everything in that directory to a new page

    /title/(.*) works fine

    however the new site also has a PAGE named /title/ and that is getting redirected

    Is there a regular expression to work around that? Redirect everything to the right, but not /title/ ?

    Thanks

  2. s_ha_dum
    Member
    Posted 1 year ago #

    Try RewriteCond $1 !^/title/$ immediately before the /title/(.*) condition.

  3. wasana
    Member
    Posted 1 year ago #

    thanks

  4. s_ha_dum
    Member
    Posted 1 year ago #

    No guarantees. I can pretty much always get these right but it sometimes takes a few tries.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.