Search code examples
wordpress.htaccesshttp-redirectsubdomainsections

Different subdomains for subpages of one Wordpress website


I would like to know, if it’s possible to assign subpages different subdomains of one wordpress website installation?

Example:

I have www.example.de/page/subpage1 and want this to redirect to > www.subdomain1.example.de and then www.example.de/page/subpage2 redirect to > www.subdomain2.example.de and so on.

The reason why I need to do this: My customer has a wordpress website with subpages which should act like different Onepagers with there own (sub)domains.


Solution

  • You would have to be really fancy about this.

    1st, you would have to setup your subdomains to be url masks. Because your wordpress is setup under example.de, every time you go to whatever.example.de it would have to be pointed to your wordpress site, and the browser would re-write the URL back to example.de. But URL masking would support this. You do all of this with your hosting (or your Linux box if you are hosting yourself)

    2nd, you would have to do the work in your .htaccess file, and setup 301 redirect for those pages.

    Redirect 301 /page/subpage1 http://whatever.example.de/