Created
January 6, 2014 03:30
-
-
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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if ($redirectURL = $c->getCollectionAttributeValue('redirect_to_url')) { | |
| if ($redirectURL != '') { | |
| Header( "HTTP/1.1 301 Moved Permanently" ); | |
| Header( "Location: " . $redirectURL ); | |
| } | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how can I make it working for anonymous users? they are not redirected, I just get that real page.