Redirects are a way of setting up rules to have pages redirect automatically for your visitors. These are great tools to use if you adjusted the pages names on your site and need former links to redirect to the new ones.
Note: If you are in the process of migrating your account and you are not using redirects, you can move on to the next section of the migration process.
Skip right to importing redirects in bulk.
About redirects with WP Engine:
At WP Engine we use a server setup that utilizes the Nginx platform as well as Apache. What this means is that you’ll want to setup all of your redirects in your User Portal instead of other ways such as using the .htaccess file or using plugins (because these are handled on the Apache level).
This article covers setting up redirects with 3 steps:
- Access the Redirects section from your User Portal.
- Input your paths in the Redirect Rules tool.
- Submitting a redirect list.
These steps are explained in more detail below.
1. ACCESS THE REDIRECTS SECTION IN YOUR USER PORTAL:
First access your User Portal at my.wpengine.com and then click the Redirect Rules button from the drop down next to the install you want to modify.
2. INPUT YOUR PATHS IN THE REDIRECT RULES TOOL:
Now you’ll be at the Redirect Rules page where you can create and configure your various redirects. The most common redirect is to simply have one page redirect to another. To set this up, first click the New Redirect Rule button.
In this example, we’ll be showing you how to redirect a single page. We are going to make janna.wpengine.com/info/ redirect to janna.wpengine.com/accounts/
First, you have the option of giving your redirect a Name to make it is easier to identify (this is just a label and doesn’t affect the redirect).
In the Domain field, you can select if you would like this redirect to affect a single domain or all of your domains (if you have more than one).
In the Source field, you’ll be entering the original path that you want to redirect from. The source requires a slight bit of regular expression syntax which works like this:
First start with the ^ symbol, this is a way of saying “starting from this point”. Then type in your source path and end with /?$ which basically indicates the end of the path to match. Our example source path is janna.wpengine.com/info/ so we’ll enter this into the Source field:
Next, we’ll enter the Destination field which is where we want the visitor to be redirected to. This section simply requires you to enter your path starting with a forward slash. Our example destination is janna.wpengine.com/accounts/ so we’ll enter this full URL (including http!) into the Destination field:
Once you have your new redirect configured, just click the Save button to save your new redirect. In the next section, you will have the opportunity to preview your site and test your new redirects.
3. SUBMITTING A LIST OF REDIRECTS.
If you already have a large list of redirects (30+) you may find it easier to submit a list of redirects and have them added in bulk. To do so, please visit your User Portal and open up a 24/7 Live Chat with us requesting a bulk import of redirects. The required format is a .txt file with the redirects in any of the “.htaccess style” formats below.
If these rules are already in your site’s .htaccess file from a previous host, feel free to copy the rules and paste them into a .txt file for our Support team to import for you.
Redirect “domain.com/path/match/” to “domain.com/something/”
Alternative format: Redirect “domain.com/path/match/” to “domain.com/something/”
Redirect 301 /path/match/?$ http://domain.com/something/
Redirect “domain.com/path/more/anything” to “domain.com/anything”
RewriteRule /path/more/(.*) http://domain.com/$1 [R=301,L]
Redirect a domain with an argument (?example-arg=123) on the end: “domain.com/path/match/?example-arg=123” to “domain.com/something/”
Redirect 301 /path/match/?example-arg=123 http://domain.com/something/
We won’t be able to import more than 1000 redirects so we suggest reviewing rules to match for patterns instead of individual pages.
We use what is called Regular Expressions (also known as Regex) in the Source section of our redirects. Regular Expressions are very useful because they allow you to specifically create more advanced search strings which can be very beneficial for configuring advanced redirects. If you would like to learn more about how they work, please see our Common Regex Used For Redirect Rules article.
Good job, now that your redirects are setup you can move on to the next step!