Viewing 6 replies - 1 through 6 (of 6 total)
  • Have you tried using a regular expression instead of simple matching. Here is the link to the doc:

    https://urbangiraffe.com/plugins/redirection/

    Within that doc, there is an example of how you capturing a group of characters from the original URL and use it to build the new URL:

    A couple of examples:

    /blog/(.*) => /$1
    This will match any URL that starts with /blog/, and will redirect it to the same URL but without /blog/. For example, /blog/2006/10/01/mypost will be redirected to /2006/10/01/mypost.

    /2006/month_(\d+)/(.*) => /2006/$1/$2
    This will match any URL that starts /2006/month_, and is then followed by a number. This will be redirected to the same URL, but without month_. For example, /2006/month_1/something will be redirected to /2006/1/something.

    To replace a single dash in a URL with a space:

    /tags/(.*?)-(.*?) => /tags/$1%20$2

    Thread Starter webmaster

    (@woodwc)

    That looks like a good way to selectively refer visitors to certain pages on the new site — but is there an easier way to just “redirect everything”?

    (Background: Both of these sites have been subject to various attacks in the past year, taking one or the other of them down . . . my goal is to keep them both “sort of” ready-to-go in case of future attacks. The “official” address is https://cob.jmu.edu/econed and it just redirects to whichever of the sites is active at the time . . . should I just give up, trust backups of the one site and clean out its folder so that a standard redirect there will work? If I renamed public_html to publicx_html on the backup site and just left everything there, would that work? Quick renaming to get it back?)

    Plugin Author John Godley

    (@johnny5)

    The regular expression /.* will match everything

    Thread Starter webmaster

    (@woodwc)

    Somehow it’s still not working. In the Redirection plugin at https://williamcwood.com/econed, I’m redirecting

    /.*

    to

    https://sites.jmu.edu/econed

    but going to https://williamcwood.com/econed still loads that native page at williamcwood.com/econed.

    Screenshot at this location.

    Plugin Author John Godley

    (@johnny5)

    Did you enable the regex checkbox? The screenshot is too small to tell

    Thread Starter webmaster

    (@woodwc)

    >Did you enable the regex checkbox?

    Ah! That did it! Thank you!

    So, for those who get this far here’s the solution: I installed the Redirection plugin and at the originalsiteURL installation of WordPress redirected

    /.*

    to

    newsiteURL

    AND checked the RegEx checkbox.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Redirect everything?’ is closed to new replies.