WordPress.org

Ready to get started?Download WordPress

Forums

Linking a subdomain to a page on my wordpress blog (9 posts)

  1. prb81
    Member
    Posted 3 years ago #

    Hi,

    I'm using 1&1 as my host but have a problem linking it to my wordpress blog for the following reason:

    I have a category for which I wanted to create a subdomain that links directly to that category. so for example:

    http://www.mywebsite.com/category/sport is the full address, but I have created a subdomain with 1&1 called sport.mywebsite.com

    At first when I typed in the subdomain it came up with an error message and 1&1 informed me I had to change the destination of my main site to the actual address.

    Unfortunately after doing that and typing in the address to http://www.mywebsite.com it came up with a blank white page and nothing more.

    What I'm trying to ask is if anyone knows how I can link a subdomain to a specific page on my site?

    Thanks for any help provided...

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    http://wordpress.org/extend/plugins/page-links-to/
    links a page to anywhere

    But with WP 3.0 menu system, you can build a menu, with links to anywhere in the menu

  3. prb81
    Member
    Posted 3 years ago #

    That does not work. According to the FAQ's

    Can this be used to repoint categories to an arbitrary URL?
    Not at this time. I'm considering it as a future feature.

    Anyone know how I can go about having my subdomain url link to a category link on my site without coming across the problems I explained above?

    Thanks

  4. prb81
    Member
    Posted 3 years ago #

    Just wondering if anyone maybe has a solution to this? I e-mailed 1&1 who informed me that to forward a subdomain to a particular category page on my WordPress hosted site I needed an index.php file on my server to point my main site to as a starting point. Would I be right in thinking that if I did this it would then become my home page and not my current homepage through my WordPress theme?

    If so, is it then impossible to do what I am hoping to do and have category.mysite.com forward to the page mysite.com/cat/category?

    Or has anyone got a solution?

    Thanks

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    What I'm trying to ask is if anyone knows how I can link a subdomain to a specific page on my site?

    That does not work. According to the FAQ's

    Can this be used to repoint categories to an arbitrary URL?
    Not at this time. I'm considering it as a future feature.

    My apologies, I answered the question you asked...not the one you meant to ask! ;)

    I'm confused on what you are trying to do? You want the category to forward to the subdomain? Or the subdomain to forward to the category?

    Or both?

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    If you are trying to forward a subdomain to a page...it's pretty simple, google will give you a variety of solutions.

    <?php
    header( "HTTP/1.1 301 Moved Permanently" );
    header( "Status: 301 Moved Permanently" );
    header( "Location: http://www.domain.com/forum/ " );
    exit(0); // This is Optional but suggested, to avoid any accidental output
    ?>

    for instance in a file named index.php in my forum.domain.com (where my forum used to be) sends people to my wordpress page /forum where my forum was moved to.

  7. prb81
    Member
    Posted 3 years ago #

    I think that is generally what I am looking to do.

    So yes. I have a page say: mysite.com/category/sport but have created a subdomain sport.mysite.com which when people type into their browser will take them to the mysite.com/category/sport page. (The actualy URL is longer and thats why I created a simpler subdomain).

    1&1 told me to create and upload an index.php file to my site and then my subdomain should recognise mysite.com/category/sport when I try to forward it there. As of now it doesn't recognise it and I get the error message because there is no index file with the wordpress files (or if there is I don't know were it is).

    I'm worried if I create a blank index.php file and upload it to mysite.com when I actually visit my site I will get that blank page rather than my WordPress hosted blog page.

  8. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    WordPress has several index.php files.

    The main one is in site root. It loads WP. The next one is in your theme, tells WP how to display stuff.

    The index.php file that you would create would go into your subdomain folder. Whatever folder you have setup for sport.mysite.com

    The index.php file would simply have a bit of code in it forwarding it to where you want it to go.... mysite.com/category/sport

  9. prb81
    Member
    Posted 3 years ago #

    Thanks, I'll give that a go this evening and report back!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags