Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

redirect help

edited August 2011 in Vanilla 2.0 - 2.8
how to redirect viewtopic.php?f=12&t=366 to discussions/some-name ?
Tagged:

Best Answer

  • Options
    LincLinc Detroit Admin
    edited August 2011 Answer ✓
    The URL you should be redirecting to is discussion/366 in this case. The 'some-name' is superfluous and can't be easily added during the redirect.

    The easiest way to explain would be to drop a file called 'viewtopic.php' into your forum folder that does this:
    <?php
    if (isset($_GET['t']) && is_numeric($_GET['t']))
       header('Location: discussion/'.$_GET['t']);
    else
       header('Location: discussions');

Answers

  • Options
    LincLinc Detroit Admin
    edited August 2011 Answer ✓
    The URL you should be redirecting to is discussion/366 in this case. The 'some-name' is superfluous and can't be easily added during the redirect.

    The easiest way to explain would be to drop a file called 'viewtopic.php' into your forum folder that does this:
    <?php
    if (isset($_GET['t']) && is_numeric($_GET['t']))
       header('Location: discussion/'.$_GET['t']);
    else
       header('Location: discussions');
Sign In or Register to comment.