WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Redirect homepage to a category

[Resolved] Redirect homepage to a category

Viewing 12 replies - 1 through 12 (of 12 total)
  • it’s bad to do this … but you can do it simply by adding this line in your header page :

    <meta http-equiv="refresh" content="0; url=Your-new-url-here">

    visionquest
    Member

    @visionquest

    Okay, that redirects to the correct page but it keeps refreshing, over and over again.

    How can it go to the page without refreshing?

    add a ” after the 0

    <meta http-equiv="refresh" content="0"; url=Your-new-url-here">

    visionquest
    Member

    @visionquest

    Unfortunately, adding the ” after the O didnt help. It just refreshed the main page over and over again.

    At least the first solution got to the redirected page but kept refreshing.

    Just wannna get to the redirected page and stay still.

    Any ideas?

    That’s not O… it is is zero [0]

    See also other solutions:
    http://www.somacon.com/p145.php
    (you want a permanent redirect = 301; otherwise the search engines might punish you)

    i know why it keep refreshing 🙂

    because the code is the header and the header is used in both the main page and category so it keep requesting for a refresh …

    my code was correct , some minor modification should be made to fix this issue …

    this should work :

    <?php
    if(is_home()){
    echo "<meta http-equiv="refresh" content="0; url=http://your-url/">";
    }
    ?>

    it work fine on IE && FF

    The only problem i see is that Search engine might not like this … as i mentioned in my first post and as moshu mentioned …

    visionquest
    Member

    @visionquest

    Thanks Chaaban for your help! Your code was correct, and the error was as you indicated.

    Incidentally, the reason I wanted to bypass the main page was because it showed the latest posts from different Parents, and I just wanted the posts from 1 parent displayed. So I redirected directly to the category.

    I’m sure there are other ways to achieve this that do not run afoul of google’s rules, but for now, this works. I will promote the site using the category name (longer url). So maybe the longer url will be indexed instead of the just the domain. Sorry for the long post. Newb’ to WP.

    You are over-complicating it 🙂
    1. Use a plugin to exclude categories to be shown on the main page:
    http://ryowebsite.com/?p=46
    2. No need for redirect
    3. The excluded posts will be shown only on their category pages.

    You should always described what you want to achieve, instead of thinking you know how to get the desired result and asking confusing “technical” questions 🙂
    You approach just doesn’t make sense, so this this should be a good lesson: describe what you want and many helpers will offer good and easy solutions.

    visionquest
    Member

    @visionquest

    Thanks Moshu. I appreciate your feedback. I was doing this for a friend and was told by her that she didnt get the answer, so I embarked on finding my own. I implemented the plugin you suggested and it worked perfectly. Thank you and the other respondents.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Resolved] Redirect homepage to a category’ is closed to new replies.