WordPress.org

Ready to get started?Download WordPress

Forums

Redirection
Regex redirect (3 posts)

  1. aruncappi
    Member
    Posted 1 year ago #

    Hi
    The person that set up our site set up wordpress in the directory /cms/..... and when live moved it to /...... causing a lot of 404 errors, im using redirect regex as follows:

    Source URL /cms/(.*)
    Target URL: http://www.domainname.co.uk/$1

    This works fine, with one exception:

    http://www.domainname.co.uk/wp-admin.php and
    http://www.domainname.co.uk/wp-login/php current redirect to
    http://www.domainname.co.uk/cms/wp-admin.php

    When using the script above the login redirects to
    http://www.domainname.co.uk/wp-admin.php which doesnt exist and therefore buggers up the admin login

    I trried to add an extra redirect before the above script to redirect the above pages to the /cms/ version and placed these before the first script hoping the redirects would stop when there was a match but this didnt work. Is ther4e any way to exclude this one address from the original script?

    http://wordpress.org/extend/plugins/redirection/

  2. aruncappi
    Member
    Posted 1 year ago #

    any advise on this greatly appreciated

  3. Blake McDermott
    Member
    Posted 1 year ago #

    I'd personally not rely on the plugin to point your entire site to the correct link. It makes more sense to clean up the mess. Your first step should be changing your Site and WordPress address url in your WordPress Panel (Settings > General) and then run a search and replace script on your entire database, Searching: http://www.domain.com/cms/ Replacing with: http://www.domain.com/. I recommend using this tool to do the search and replace, but backup your database before making any changes in the event you hose something up.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags