Jump to content

Redirect Page to external site.


abedia
 Share

Recommended Posts

Kind of new to the process wire environment. I've tried for hours to figure this out. I want a menu entry (page) that goes to an external site. This seems to be much easier said than done.

I made a field called redirectTo of type URL. I added it to a template I made called redirectPage. In the redirectPage.php, this is what I put:

<?php

$session->redirect( $page->redirectTo->url );

?>

Apparently this isn't good enough, or I'm just doing something wrong. Forgive any ignorance on my part. All it seems to want to do is redirect to itself over and over again, or something. I even tried changing it to something like...

<?php

echo $page->redirectTo->url;

?>

I don't remember if this was the exact thing I tried, but it just returns nothing. Can someone help me here? I was trying to base it off of this, but it just does not work for me: https://processwire.com/talk/topic/341-uri-redirect/

Thanks all.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...