SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2003
    Location
    Romania
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Bug in search engine friendly urls

    http://www.sitepoint.com/article/485
    Try going to http://www.sitepoint.com/article//485
    Your technique is wrong - you need to do this:
    $var_array = explode("/",$PATH_INFO);
    Instead of that - use:
    $pi=preg_replace('@/{2,}@','/',$PATH_INFO);
    $var_array = explode("/",$pi);
    That will replace any two or more slashes(//-/*n) with a single /.
    Thats a good fix - and wont hog the CPU.
    Thanks,
    Dan

  2. #2
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Their method is correct. Doing a preg_replace on every uri is unnecessaire since the articles are linked correctly. If a user changes the uris, don't expect them to work correctly.


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
  •