Contents
Can you use redirection with no regular expressions?
You could theoretically build a similar system of redirects with plain text (that is, with no regular expressions), but this method allows you to accomplish the same thing with far less data entry, and in a way that can cover an infinite number of URLs.
Which is the best redirection plugin for WordPress?
There are many ways to approach redirects, but the simplest and easiest to manage is the Redirection plugin by John Godley. (Note there are a number with similar names, so make sure you grab this one.) While far from perfect, this is a handy tool because:
When to use.htaccess when redirecting in WordPress?
If you are getting crazy redirect loops with the Redirection plugin, contact your host about redirecting with .htaccess. The regular expression formatting is similar, but using .htaccess can ensure the problematic redirects are executed before the WordPress ones, which usually resolves any lingering issues.
Is there such thing as an infinite redirect?
And so: A frequently occurring problem with regular expression is an infinite redirect. That is, you create a regex that redirects to a URL that is itself caught by the same regular expression. This is then redirected again, and again, and again until the browser stops with a ERR_TOO_MANY_REDIRECTS message (or equivalent).
Which is the first part of a redirect?
The first crucial components of your regular expression redirect are the “start” and “end” characters. This allows you to dictate the beginning and end of the expression to match, and prevents a lot of accidental redirect loops when you use it correctly.
Can a regex url match a regular expression?
A regex URL can match many URLs. In addition to matching many URLs, a regular expression can extract information from the source URL and copy it to the target URL. A few examples may be helpful. A redirect that has the source URL /my-url will only ever match requests for /my-url.
Is there a way to redirect a WordPress page?
You can use this even if your server doesn’t run Apache or doesn’t allow you to edit .htaccess (which is the alternative method for adding redirects in most cases). Install and activate the plugin, then navigate to Tools > Redirection to get started.