WordPress.org

Ready to get started?Download WordPress

Forums

Is it possible to forward a page? (13 posts)

  1. techgeek
    Member
    Posted 5 years ago #

    Hey everyone. Just wanted to ask a quick question. Using a downloaded version of WordPress, as in an install on a non wordpress server, is it possible to forward a page? I want to make it so that when someone click a page in the top bar, it takes them to a different website. Is that possible?

    Thanks,
    Techgeek

  2. rawguru01
    Member
    Posted 5 years ago #

    I would like to know as well. :)

  3. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    Do you mean redirect to different page? Sure you can. What is a non-wordpress server btw?

  4. rawguru01
    Member
    Posted 5 years ago #

    I think he mean to direct it to a different link. Is that possible?

  5. NC@WP
    Member
    Posted 5 years ago #

    Let's say you want to have a page titled "Redirect Page" that would redirect to http://someothersite.com/ . So here's what you need to do:

    1. Create an empty page called "Redirect Page" with the slug redirect.

    2. Create a file in your theme directory called redirect.php (the name of the file must match the page slug exactly).

    3. In that file, put the following:

    <?php 
    
    header('Location: http://someothersite.com/');
    die();
    
    ?>

    Be sure that the file starts with <?php and there is no whitespace in front of the <.

    This will create an (empty) page, which would redirect to the specified URL.

  6. techgeek
    Member
    Posted 5 years ago #

    NC@WP, you answered my question. mercime, I consider a non wordpress server one that wordpress does not own. I do have one question. What is the slug of a page/how do you edit it?

  7. NC@WP
    Member
    Posted 5 years ago #

    techgeek,

    If you have a page that you can access as www.yoursite.com/yourpage, yourpage is the slug. By default, the slug is a modified ("nice") representation of the page title (lower-case, with whitespace replaced by dashes). As to editing it, the procedure depends on the WordPress version you're running...

  8. techgeek
    Member
    Posted 5 years ago #

    OK, slight problem. When I make a page, the end is like "?pageid=19" or something like that. Also, the page is called forum, and I have a directory called forum on the webserver. How can I combat this?

  9. NC@WP
    Member
    Posted 5 years ago #

    techgeek,

    When I make a page, the end is like "?pageid=19" or something like that.

    The page still has a slug, and WordPress would still search for a corresponding page file in the theme.

    Also, the page is called forum, and I have a directory called forum on the webserver. How can I combat this?

    There's nothing to combat. The forum page will redirect to forum one way or another. See this post in my blog. Or is this something you are actually trying to avoid?

  10. techgeek
    Member
    Posted 5 years ago #

    I got it. I had to mess with a permalink thing.

  11. pathtales
    Member
    Posted 5 years ago #

    I followed these instructions to the letter and I still can not get it to work. Is there something I am missing?

  12. seniorcarelist
    Member
    Posted 5 years ago #

    HI NC@WP,

    Create an empty page called "Redirect Page" with the slug redirect.

    Where do I create that page? In the dashboard - where I add a page? Or in the theme folder using notepad?

    Thnaks for helping a newbie

  13. elk80
    Member
    Posted 5 years ago #

    I figured it out. You have to put the redirect.php file in the TOP wordpress directory, the same directory that has index.php and wp-app.php and the readme in. Putting it in the Theme directory doesn't work for me, at least on my version of WordPress (2.7)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags