Results 1 to 7 of 7

Some php code seems changed

This is a discussion on Some php code seems changed within the Feedback forums, part of the General category; I just noticed the php adresse changed, which affected EVERY single old ko4life links, none of them works anymore. The ...
Page: 1


  1. #1
    Senior Member C4pt4iN's Avatar
    Join Date
    Mar 2006
    Posts
    1,552

    Default

    I just noticed the php adresse changed, which affected EVERY single old ko4life links, none of them works anymore. The old ones used to be viewtopic.php?t= but now index.php?showtopic=

    Devile, if u see this first, try click at ur own signature, and ull see it gets u to the main page :P

    U guys prolly already know/have a solution for that easily, but I think it would easiest if u just make a script that convert the old adresse to the new one when ppl click at it. Not server side, just client side to help ppl so they dont have to manually edit the adresse if they dont know how h34r:

  2. #2
    Heim4teil
    Guest

    Default

    yeah captain your PK link dont work anymore too :S

  3. #3
    h4x0r Admin Devile's Avatar
    Join Date
    Mar 2006
    Posts
    2,545

    Default

    I'm working on mod_rewrite stuff to do this. I'm not an expert (yet) on mod_rewrite, so I just added a rewrite from:

    viewtopic.php?* ---> index.php?*

    So instead of getting an ugly "404 Page Not Found" error u go to the forum index. I'm not sure if ALL the old phpBB URLs have an exact match in IPB URLs. Maybe the forums (?f=), but prolly not with topics and posts. Not sure if its even worth the trouble. I'll still try it since I love learning and this 160 pages "The Definitive Guide to Apache mod_rewrite" book looks pretty good.

    Weird how u guys reported this now, when before the change those URLs didnt work at all.

  4. #4
    Senior Member C4pt4iN's Avatar
    Join Date
    Mar 2006
    Posts
    1,552

    Default

    Weird how u guys reported this now, when before the change those URLs didnt work at all.[/b]
    Im not that active on the forum, but when I am, I usually clicking here and there, and paying much attention to if everything works 100% :P

  5. #5
    Hypnos
    Guest

    Default

    Dev, I posted this right after the switch:
    http://www.ko4life.com/forums/index.php?showtopic=85945

    It's a simple PHP script that sends the same sort of response (Header, not HTML/Javascript) that an Apache redirect would.


    If you do it with Apache, I would use a RedirectMatch. Not mod_rewrite (RewriteRule).
    I'm working on mod_rewrite stuff to do this. I'm not an expert (yet) on mod_rewrite, so I just added a rewrite from:

    viewtopic.php?* ---> index.php?*

    So instead of getting an ugly "404 Page Not Found" error u go to the forum index. I'm not sure if ALL the old phpBB URLs have an exact match in IPB URLs. Maybe the forums (?f=), but prolly not with topics and posts. Not sure if its even worth the trouble. I'll still try it since I love learning and this 160 pages "The Definitive Guide to Apache mod_rewrite" book looks pretty good.

    Weird how u guys reported this now, when before the change those URLs didnt work at all.[/b]

  6. #6
    h4x0r Admin Devile's Avatar
    Join Date
    Mar 2006
    Posts
    2,545

    Default

    I rather do it with Apache since its lot faster than application code.

    About RedirectMatch, dont think that would work since it only takes into account the URI and not the QUERY_STRING. From mod_alias docs:

    mod_alias is designed to handle simple URL manipulation tasks. For more complicated tasks such as manipulating the query string, use the tools provided by mod_rewrite.[/b]
    I'll doublecheck anyway.

    Thats why I'm working with mod_rewrite and RewriteCond instead.

    PS: Current redirects are plain mod_alias redirects tho. Ignoring query strings for now.

  7. #7
    Protoss Arbiter Senior Member
    Join Date
    Mar 2006
    Location
    California
    Posts
    2,296

    Default

    Or create a file named viewtopic.php and

    <?php
    header (&#39;Location: index.php?showtopic=&#39; $_GET[&#39;t&#39;]);
    ?>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •