Skip to content

Instantly share code, notes, and snippets.

@pixmonkey
Created January 6, 2014 03:30
Show Gist options
  • Save pixmonkey/8277795 to your computer and use it in GitHub Desktop.
Save pixmonkey/8277795 to your computer and use it in GitHub Desktop.
Redirect to URL in Concrete5. This code goes into the theme header. New page attribute needs to be created called "redirect_to_url".
<?php
if ($redirectURL = $c->getCollectionAttributeValue('redirect_to_url')) {
if ($redirectURL != '') {
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: " . $redirectURL );
}
}
?>
@madalinignisca
Copy link

how can I make it working for anonymous users? they are not redirected, I just get that real page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment