Wildcard Redirect Ignored by Wordpress?

I have two WordPress sites that each have more than one domain pointing to them. I’ve added some wildcard 301 redirects in cPanel.

When I go to https://newworld.university it redirects to https://newworld.ac which is expected behavior.

When I go to https://newworld.university/anythingelse it does not redirect, but shows https://newworld.university/anythingelse

So I take it that WordPress is negating the wildcard part of the redirects somehow? What else should I be doing here? Thanks!

That is most likely the case. In my experience, setting up Redirects using the cPanel Redirects tool over the top of a WordPress site will often result in problems like this. cPanel’s own documentation says this as well:

You may have better luck manually setting this up using a .htaccess file, but this can be tricky to set up:

You could also try managing redirects by installing the Redirection plugin inside of WordPress, but I’m not sure if it does wildcard redirects:

I edited the .htaccess file to add this to the beginning:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(?:www\.)newworld\.university$ [NC]
RewriteRule ^ http://newworld.ac%{REQUEST_URI} [L,R=301]

Nothing changed, but I’m guessing that’s because I didn’t restart Apache. Maybe this is really dopish, but I don’t see how to do that, since the terminal available through cPanel doesn’t seem to recognize any command I type into it.

Restarting apache won’t be necessary for .htaccess changes, and you won’t be able to on shared hosting, as you do not have root access to the server.

I would suggest reaching out to our support at support@reclaimhosting.com and we can take a look more specifically at your situation here and help you out.

This topic was automatically closed after 365 days. New replies are no longer allowed.