Support » Plugins » Hacks » Can I get a little help on this code snippet?

  • I am trying to get a message displayed after being 301 redirected from an old site. I was given this PHP snippet to use along with adding “?redirect=true” to the redirect in .htaccess.

    However the following code is returning a Parse error, and I’m not savvy enough to troubleshoot it. I am smart enough to put <?php and ?> before and after the code though.

    Little help? Thannks!

     if($_GET['redirect'] == 'true'){
     ?><div class='redirected'>You were redirected!</div><?
Viewing 2 replies - 1 through 2 (of 2 total)
  • the code seems to be missing a square closing bracket:


    if this is not all then change the php shorttag to:

    ..... redirected!</div><?php

    That totally fixed it!!!

    Now the only issue I have is that adding ?redirect=true to the end of the urls makes it so that may exact match urls don’t work.

    If I have I’d like to go to
    But with this script I get
    And since that’s not a real page it displays the first page.

    I know you weren’t expecting that can of worms… Ha! Any idea of where i could go from there? Or maybe I should post a new thread…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can I get a little help on this code snippet?’ is closed to new replies.