ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Redirect not working

April 07, 2011 3:09pm

Subscribe [3]
  • #1 / Apr 07, 2011 3:09pm

    CelebrationWeb

    38 posts

    I’m trying to add a navigation item that will redirect the user to a different website.  So I made a new category called ‘Redirect’ and then created a template also called ‘Redirect’. In the template I put;

    {redirect="http://www.newsite.org/"}

    but this doesn’t work, it just stays on the same page. What did I do wrong?

  • #2 / Apr 08, 2011 6:32am

    John Henry Donovan

    12339 posts

    CelebrationWeb,

    Can I ask why you just don’t link to the website directly from the navigation item?
    The redirect I believe is just for redirecting to another template.

    You could drop some PHP in that template to do the redirect. Make sure to enable PHP for the template

    <?php
    
       header( 'Location: <a href="http://www.newsite.org/">http://www.newsite.org/'</a> ) ;
    
    ?>
  • #3 / Apr 08, 2011 10:19am

    CelebrationWeb

    38 posts

    Hi John,

    Still can’t get this to work. I removed all the old stuff that was associated with this including removing the category. I made a new template with only the php redirect, then created a new category and dropped that in the navigation structure. Php is enabled. Now when I click it, it just opens a blank frame on the main site.

    What could I possibly be missing here????

  • #4 / Apr 09, 2011 11:02am

    Greg Salt

    3988 posts

    Hi CelebrationWeb,

    Do you have a link to your site where we can see this? Are you using a frameset? What happens when you navigate to the template directly, are you redirected?

    Cheers

    Greg

  • #5 / Apr 09, 2011 11:11am

    CelebrationWeb

    38 posts

    Hi Greg,

    It’s over here -> http://www.celebration.org/

    The two things that I am having trouble with are;

    1. When clicking on Ministries->Personal Devotion I am trying to get it to behave the same as when clicking on Get Connected->Personal Devotion.

    2. When clicking on Giving->Imagine I need to be redirected to http://imagine.celebration.org

    I’ve tried many different things to get this to work like that but all end up really messing things up.

    Thanks!

  • #6 / Apr 09, 2011 11:22am

    Greg Salt

    3988 posts

    Hi CelebrationWeb,

    1. When clicking on Ministries->Personal Devotion I am trying to get it to behave the same as when clicking on Get Connected->Personal Devotion.

    As far as I can tell they are the same except for that one url_title has a 1 at the end of it. What is not working with this?

    2. When clicking on Giving->Imagine I need to be redirected to http://imagine.celebration.org

    Just to confirm you are using categories to generate the navigation on the right-hand sidebar? If so, can you please post the code that you are using for that.

    Cheers

    Greg

  • #7 / Apr 09, 2011 11:29am

    CelebrationWeb

    38 posts

    Greg,

    On #1 I want that sub-menu to be the same for both. I have them both set-up the same in my categories but only the first one works.

    How do I get to the code for my categories?

  • #8 / Apr 10, 2011 1:31pm

    Greg Salt

    3988 posts

    Hi CelebrationWeb,

    This is the same issue as is currently being dealt with in your other thread right? In which case can I merge them or just close this one?

    Cheers

    Greg

  • #9 / Apr 10, 2011 1:48pm

    CelebrationWeb

    38 posts

    Not really. On this one I just want a sub level navigation item that goes to another site.

    Giving/Imagine should go to http://imagine.celebration.org

    So I have a template in the Giving group called ‘imagine’ with nothing in it but this…

    <?php header('Location: <a href="http://imagine.celebration.org/">http://imagine.celebration.org/'</a>);  ?>

    .. but it just gets ignored.


    This seems to be the biggest problem for me, trying to get pages to go somewhere other than were they want to go.

  • #10 / Apr 10, 2011 5:00pm

    CelebrationWeb

    38 posts

    It seems that the problem was this;

    <?php header(“Location:http://imagine.celebration.org”); exit; ?>

    just added the exit and removed the trailing / in the location and this fixed both my problems.

  • #11 / Apr 11, 2011 5:02pm

    Sue Crocker

    26054 posts

    Sounds good. Glad you have a solution. Feel free to start a new thread if you have any more questions.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases