• Contact Us
  • About 1 Day Works
  • My Courses
  • My account
  • Cart
  • Shopping Cart Shopping Cart
    0Shopping Cart
1 Day® Works
  • Memberships
    • Freelancer Membership
    • Agency Membership
  • 1 Day Website Certifications
    • 1 Day® Website Agency Certification
    • 1 Day® Website Designer Certification
    • 1 Day® Website Writer Certification
    • 1 Day® Website Developer Certification
  • Courses
  • WordPress Plugins
  • Creative Tools
    • Digital Tools & Templates
    • Brand Core Values Exercise
    • Brand Voice Exercise
    • Brand Archetype Quiz
    • Brand Archetype Word Bank
    • Tangible Creative Tools
  • Blog
  • Get a 1 Day® Website
  • Menu Menu
Blog
Changing Wordpress Permalinks to Make a Wildcard 301 Redirect

Setting up Wildcard 301 Redirects with WordPress

October 30, 2023/in Website Development /by 1 Day Works

What is a Wildcard Redirect?

A wildcard redirect is a type of website redirect that automatically forwards all URLs under a certain domain or directory to corresponding URLs under a different domain or directory. It uses a wildcard character (often *) to match and redirect multiple URLs in a single rule, rather than setting up individual redirects for each page. To learn more about adding basic 301 redirects with a plugin in WordPress, check out this post.

How it works:

  • The wildcard (*) acts as a placeholder for any text or path in the URL.
  • It captures everything after a specified base URL and redirects it to a new location, preserving the URL structure.

Example:

  • Original domain: oldsite.com
  • Redirect domain: newsite.com

A wildcard redirect rule could ensure:

  • oldsite.com/page1 → newsite.com/page1
  • oldsite.com/blog/article → newsite.com/blog/article

When Do You Need Wildcard Redirects?

If you are switching domains (e.g. going from oldexample.com to newexample.com), luckily you don’t have to create a 301 redirect for every page and post on the site. Whew! That could take a while for large sites. Wildcard redirects allow you to redirect all of the URLs on your site to another domain with a single redirect rule.

Domain Changes

When moving an entire website to a new domain, a wildcard redirect ensures users and search engines are directed to the equivalent pages on the new domain.

Directory Changes

Wildcard redirects can also be used when there is a single variable changing — for example, one folder or directory name. The rest of the URL path must be kept consistent to use a wildcard.

If you are changing URLs in bulk and there is only a single change being made in the path, wildcards can be an option to redirect all those within a subfolder or subdirectory without the need to implement an individual redirect for each.

If there is more than one variable in a path changing, redirects wouldn’t be suitable.

SEO Maintenance

While optimizing your website for SEO, you might make a change like adding a parent page and subpages to the site to have a clearer site hierarchy. If you reorganize your site’s structure or move an entire folder to a new location, a wildcard redirect keeps the paths intact. Wildcard redirects help preserve SEO value by maintaining link equity and preventing broken links.

Case Study Example for Wildcard Redirects on WordPress

When we built the website for the Wisconsin Bankers Association, we were migrating from an old CMS to WordPress. The website had hundreds of old posts, some of which were labeled “Press Releases” and some of which were called “Articles.” Here are examples of two of the old URLs.

https://www.wisbank.com/press-releases/2020/05/wba-press-release-can-i-wear-a-mask-into-my-bank

https://www.wisbank.com/articles/2021/10/advocacy-on-regulatory-modernization

On the new site, we wanted both the Articles and the Press releases to live on the Blog. The new URLs that we wanted to create looked like this:

https://www.wisbank.com/2020/05/wba-press-release-can-i-wear-a-mask-into-my-bank

https://www.wisbank.com/2021/10/advocacy-on-regulatory-modernization

In other words, we wanted to remove the words “press-releases” and “articles” from the URLs. And we didn’t want to have to manually create hundreds of 301 redirects!

Enter the wildcard redirect! Wildcard redirects are a slightly more advanced feature that let you dynamically redirect multiple pages with a single redirect rule.

Using the Redirection WordPress plugin and the built-in permalink structure in WordPress, we were able to easily achieve our mission.

First we changed the Permalinks from “Post name” to include the date with the “Month and name” option. Lucky for us, the date format was the same as the old platform!

Wordpress Permalinks

(Note, please ignore the fact that those URLs in that screenshot don’t have https. They should!)

Now you might think that we could have added “/articles…” in the Custom Structure permalink, but because we also had to deal with press releases, we also needed the wild card redirect.

Wildcard Redirect

Using the Redirection plugin, we created the following rule:

Choose “Regex” in order to use regular expressions in the rule. Also, it’s good practice to always “Ignore Slash” and “Ignore Case” unless you have a good reason not to!

In the Source URL field: /articles/ represents the part of the URL that we are trying to change.

The ^ is there to help prevent infinite redirect loops.

The (.*) is the wildcard / dynamic information, that indicates …and whatever comes after /articles/.

Then in the Target URL, we can use the /$1 to indicate that we are replacing /articles/ with nothing. And then we are taking what was stored in the wildcard and adding it.

Then we made a similar redirect rule for the press release section by simply replacing “articles” with “press-releases”:

Once those rules were in, we tested it by trying to navigate to some of the old URLs, and they worked!

Note: If you aren’t seeing your redirect work right away but you are pretty certain it should work, you may need to delete your htaccess file via FTP or the File Manager. (As always, download a copy before deleting it just in case!)

 

Resources to learn more: 

Understanding Redirection Regular Expressions

Adding 301 Redirects in WordPress

 

Tags: 301 redirects, Redirection plugin, wildcard redirect, WordPress
Share this entry
  • Share on Facebook
  • Share on X
  • Share on WhatsApp
  • Share on Pinterest
  • Share on LinkedIn
  • Share on Tumblr
  • Share on Vk
  • Share on Reddit
  • Share by Mail
https://1dayworks.com/wp-content/uploads/2021/10/permalink-options.png 424 673 1 Day Works https://1dayworks.com/wp-content/uploads/2020/09/1-day-works-logo-150.png 1 Day Works2023-10-30 18:08:232025-01-09 14:58:49Setting up Wildcard 301 Redirects with WordPress

Categories

  • Branding
  • Communication & Customer Service
  • Contracts & Paperwork
  • Design
  • Freelancing
  • Growing Your Freelance Business
  • Hiring & Outsourcing
  • News
  • Press
  • Productivity & Systems
  • Project Management & Scoping
  • Sales & Marketing
  • Starting a Freelance Business
  • Tools & Software
  • Web Designer Best Practices
  • Website Development
  • WordPress

Recent Posts

  • Anatomy of a URL
    How to Add 301 Redirects in WordPressJanuary 9, 2025 - 2:56 pm

Tools and Training for Your Creative Business!

1 Day Works® World Headquarters
2002 Atwood Ave. Ste. 211
Madison, WI 53704
USA

Sign up for our newsletter to get industry news, workflow tips, jokes about Papyrus and other fun stuff.

Get the Skinny!
2025 © Copyright | 1 Day Website design by Bizzy Bizzy
  • Link to Instagram
  • Link to Facebook
  • Link to X
  • Link to Pinterest
  • Link to LinkedIn
Link to: Image File Naming Conventions Best Practices for Web Designers Link to: Image File Naming Conventions Best Practices for Web Designers Image File Naming Conventions Best Practices for Web DesignersScreen with Image File Naming Conventions Link to: How to Add 301 Redirects in WordPress Link to: How to Add 301 Redirects in WordPress Anatomy of a URLHow to Add 301 Redirects in WordPress
Scroll to top

This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies. P.S. We also like eating cookies.

OKLearn more

Cookie and Privacy Settings



How we use cookies

We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

Essential Website Cookies

These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

Because these cookies are strictly necessary to deliver the website, refusing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

Google Analytics Cookies

These cookies collect information that is used either in aggregate form to help us understand how our website is being used or how effective our marketing campaigns are, or to help us customize our website and application for you in order to enhance your experience.

If you do not want that we track your visit to our site you can disable tracking in your browser here:

Other external services

We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

Google Webfont Settings:

Google Map Settings:

Google reCaptcha Settings:

Vimeo and Youtube video embeds:

Other cookies

The following cookies are also needed - You can choose if you want to allow them:

Privacy Policy

You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

Copyright & Privacy
Accept settingsHide notification only

Sign up for our newsletter!

 

  • This field is for validation purposes and should be left unchanged.