WordPress.org

Ready to get started?Download WordPress

Forums

Single page as subdomain (4 posts)

  1. Harvi
    Member
    Posted 5 years ago #

    Hi,
    I want to create subdomain in wordpress. I`ve got page 'test' in WP , i want to create subdomain test:

    - mypage.com/test ---> test.mypage.com

    How can I do it? Is it possible in WordPress?

  2. citynode
    Member
    Posted 5 years ago #

    That looks like a DNS change, not a WordPress change.

    Set up your subdomain on/with/through/by your host, through whatever handles the DNS for your domain. Wherever that happens to be, (could be a different server entirely, or a directory outside or inside your original document root) you will install WordPress afresh, just make sure its a directory that has all the requirements for WordPress available.

    Common mistake: calling a directory under a domain a 'subdomain' ... like http://mydomain/test/ It doesn't seem like you're making that mistake, so good, you have that terminology straight.

    WordPress can't make people on the internet find a subdomain to any particular document root, but it can serve up pages from there, if you install it.

  3. wmrom
    Member
    Posted 5 years ago #

    to display a 'single page' on a subdomain, I copied the index.php file and put it in the subdomain's directory and changed

    require('./wp-blog-header.php');

    to

    require('../wp-blog-header.php');

    This only works if your subdomain is run out of a child directory of the one WP is installed in. To make it display the content of the page I wanted on it, I added

    $_GET['page_id']=XXX; where XXX is the page_id number. This only works if your permalinks are set to the default of p=XXX, page_id=XXX, etc.

  4. wmrom
    Member
    Posted 5 years ago #

    to display a 'single page' on a subdomain, I copied the index.php file and put it in the subdomain's directory and changed

    require('./wp-blog-header.php');

    to

    require('../wp-blog-header.php');

    This only works if your subdomain is run out of a child directory of the one WP is installed in. To make it display the content of the page I wanted on it, I added

    $_GET['page_id']=XXX;

    where XXX is the page_id number. This only works if your permalinks are set to the default of p=XXX, page_id=XXX, etc.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags