Support » Fixing WordPress » Wildcard redirect for WordPress

  • I have a wordpress installation set up on an add on domain. I was wondering if it is possible to do a wild card 301 redirect on all the pages so that the sub domain does not get indexed by the search engines. Not sure if I need to clarify but shall try. When you purchase a hosting account they assign a primary domain to the account. All of the add on domains are housed in folders within the primary domain. So if I used as an add domain it would be accessible through as well as

    I performed a 301 wild card redirect through cpanel but it only redirects the home page. So, if wanted “” redirected to “” the cpanel 301 option will not work. For some reason wordpress takes presidence over the other files. This is just a single blog and not a multi-user site. In my quest to find an answer it seems to always be related to the multi-user version. Any help would be appreciated.

Viewing 10 replies - 1 through 10 (of 10 total)
  • it would be accessible through as well as

    Did you mean that you can host sub-domains, but that if the main domain was that a sub-domain example would be ???

    Ask host to review this with you.

    I do not want the site accessible through the subdomain but only through the add on domain. I am worried about google seeing both web addresses and getting penalized for duplicate content. Already, google has indexed the subdomain version rather than the addon domain which I have appended to the folder. Host would not cover this as it is an issue with wordpress. I can create an html website and use the cpanel wild card redirect and it will redirect every file to the domain. So, if someone manually typed in or tried to visit the subdomain version it would automatically 301 redirect them away from the subdomain and to the domain. What I mean is, if someone went to they would be automatically redirected to

    You see, by default the subdomain is created by the server when an add on domain is created. The subdomain was not created by me purposefully but is just an automatic process. As soon as you go into cpanel and create an addon domain it is filed under the primary domain of the account…hence…

    I want to ensure that my website will redirect all visitors to the domain used for the addon and not be associated with the subdomain created by the addon process.

    website that is not wordpress based can easily accomplish this through creating a wild card 301 redirect. Unfortunately, creating a wild card redirect for a domain that is wordpress based only redirects the home page and does not work for any of the other files as with html based instalations…

    Moderator kmessinger


    I think that is probably because of many of the pages being produced on the fly. The page isn’t there when the redirect is applied and only appears latter.

    I want to ensure that my website will redirect all visitors to the domain used for the addon and not be associated with the subdomain created by the addon process

    There are thousands of WP sites out there just using it out of the box so I don’t think this is a problem.

    But there must be a way to redirect all people going to the subdomain version to just the domain version for all posts and files under the addon domain???

    a wild card 301 redirect for wordpress?

    Moderator kmessinger


    Maybe. You can also look here,

    301 redirects works when your host supports them

    I think you must misunderstand…obviously 301 directs work when the web host supports them…cpanel 301 redirects also work on the home page of wordpress sites but not any other…try it…create a cpanel 301 redirect to your wordpress site and then try to access a non home page link through your primary domain subdomain.

    In theory a permanent redirect from a subdomain to the primary domain should work, yes. In practice, it does seem to cause random and strange errors because cPanel also creates a bunch of redirects of its own when it creates the addon domain. (It is essentially a domain pointed to folder on another domain.)

    My suggestion is contact your webhost’s support and ask them if there’s some rewrite rule that’s interfering or if they can set it up for you.

    I see, did you first create a qualified sub-domain and then create the add on domain (both pointing to same folder)? Is so, ask host to fix…

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Wildcard redirect for WordPress’ is closed to new replies.