WordPress.org

Ready to get started?Download WordPress

Forums

Directly to subpage when root page is selected (6 posts)

  1. mreddy
    Member
    Posted 8 years ago #

    Is there a way to go directly to a certain sub page when a page is selected? Example: I have a Gallery page with subpages Gallery1, Gallery2, etc. So I would like to go directly to Gallery1 when the user navigates to Gallery root page.. Thanks!!!

    PS. I asked this alredy, but can not find the post now. I really have to say that the search engine on this forum needs improvement. Or the post has been deleted for some reason.

  2. Medizinische Abkuerzungen
    Member
    Posted 8 years ago #

    There are different ways.

    Use .htaccess

    use an index.php which redirects to the subpage

  3. mreddy
    Member
    Posted 8 years ago #

    So in index.php I check if the page is Gallery page and then redirect to Gallery1? Ok. I will try that, trying to find the right methods :) Thanks!

  4. Medizinische Abkuerzungen
    Member
    Posted 8 years ago #

    You put a new index.php in your gallery-subdir

    <?php

    header ('HTTP/1.1 301 Moved');
    Header('Location: http:/www.yourwebs.com/gallery.html');

    ?>

    Use two // not one in url

  5. mreddy
    Member
    Posted 8 years ago #

    Thank you for your reply! But what do you mean by "index.php in your gallery-subdir"? WordPress pages are stored in a database, right?

  6. Medizinische Abkuerzungen
    Member
    Posted 8 years ago #

    Yes,
    but if you use permlinks the htaccess checks if the file exists. If so it will serve out the file.
    It is possible that the wordpress shows malfunctions after creating a subdir, it normally uses virtually. (I didn't try). In that case you have to redirect via htaccess

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags