subdomain redirects to page and stays visible in address bar


in subdomain multisite installation, there is a need to create unusual redirect. I need to configure subdomain, which redirects to and needs to stay visible in address bar. This is internal configuration (subdomain to page in wordpress).

Could you please give a hint where this configuration could be done, without harming generic multisite configuration? (htaccess?)

Best regards,

  • wash

    Hello @sjaved,

    thank you for quick reply, I'm good. How are you?

    Background is fairy simple: wordpress multisite installation runs main portal and also contains several sub-portals ( Some content has been created and published as a page in main portal (mentioned page: Customer created business around this particular content and requested presenting this page as subdomain page

    This could be achieved by simply redirecting subdomain, but condition was for the whole section to 'appear" as separate page (under subdomain). Therefore, must stay in address bar - simple redirect is not sufficient.

    I was wondering if there is any way to get configuration close to customer request (via dns or htaccess?). What I mean is visitor goes to as sees in address bar.

    If not, content needs to be moved to separate page in multisite, which costs more effort that configuration, probably. Hope this helps, in case of any questions I'll provide more. Thank you for your time.

    Best regards and thank you for reply,

  • Ivan Shulev

    Hey Milosz,

    I hope you are having an awesome day!

    From what I understand (correct me if I'm wrong), holds custom content that needs to be accessed by a subdomain of the main install while the address remains the same in the browser.

    This can be achieved with Apache proxy ( Make sure to enable that module first.

    Then you can add the following code right after the opening RewriteEngine On directive in your .htaccess file. It is important for this rule to be the first in the file, otherwise it might not be reached. The code also assumes you do not have SSL enabled.

    RewriteCond %{HTTP_HOST} ^site1\.siteaddress\.com$ [NC]
    RewriteRule ^(.*)$$1 [P]

    For example, can now be reached by

    The "[NC]" flag makes sure that the match ( is not case-sensitive. The "[P]" flag tells Apache to proxy the request (the important flag).

    If you are using SSL, you would have to adjust the code accordingly.

    You can debug the redirect with RewriteLog -

    Please share how it turns out and I will be happy to assist you further.

    Have a nice day!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.