Title: Regex ^/(.*) www problems
Last modified: April 24, 2023

---

# Regex ^/(.*) www problems

 *  Resolved [BupNup](https://wordpress.org/support/users/bupnup/)
 * (@bupnup)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/regex-www-problems/)
 * Hi,
 * I’m redirecting an old domain to a new domain using Regex.
   **Source:** ^/(.*)**
   Target:** [https://newdomain.com/$1](https://newdomain.com/$1)
 * But when I try to access [https://www.olddomain.com](https://www.olddomain.com),
   I’m not redirected to the matching page in the new domain. Instead, I get a “
   Your connection is not private” message and a “NET::ERR_CERT_COMMON_NAME_INVALID.”
 * It only happens when I add the www.
 * What am I doing wrong?
   Can you help?Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/regex-www-problems/#post-16682003)
 * Do you have an SSL certificate for the `www` domain? The plugin cannot resolve
   those kind of problems for you and the domain will need to be valid.
 *  Thread Starter [BupNup](https://wordpress.org/support/users/bupnup/)
 * (@bupnup)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/regex-www-problems/#post-16682049)
 * I do. Actually, everything works fine with the old domain if I disable the redirect.
   I’m using Cloudways for hosting and enabled the Let’s Encrypt certificate.
 * I also use Cloudflare for DNS and have the SSL/TLS set to full.
   It just happens
   when I have the redirect enabled and add the www to the URL.The only plugins 
   I have installed on this WordPress installation are the Redirection plugin and
   a Cloudways Bot protection plugin.
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/regex-www-problems/#post-16682119)
 * I don’t know what those Cloudways/Cloudflare things are, so cannot comment there.
 * Do you have a full URL for the one showing an error?
 *  Thread Starter [BupNup](https://wordpress.org/support/users/bupnup/)
 * (@bupnup)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/regex-www-problems/#post-16682297)
 * Hi John,
 * Thank you for your time. I just solved the issue.
   In fact, I didn’t have the 
   certificate for the www subdomain installed.
 * For anyone in the future experiencing the same issue I had, all you have to do
   is install the let’s-encrypt certificate with wildcard enabled.
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Regex ^/(.*) www problems’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [BupNup](https://wordpress.org/support/users/bupnup/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/regex-www-problems/#post-16682297)
 * Status: resolved