Results 1 to 3 of 3
  1. #1
    Pligg Donor ablaye's Avatar
    Joined
    Sep 2007
    Posts
    62
    Thanks
    Received:0
    Given: 0

    [SOLVED] htaccess bug (mod rewrite) with category name containing '_' symbol

    There is a bug in the .htaccess file.
    When the URL-friendly category name has an '_' as in Arts_Sciences, the htaccess file can not parse the URL correctly and you end up with a 404.

    To fix this problem, the lines below:

    RewriteRule ^published/([a-zA-Z0-9-]+)/category/([a-zA-Z0-9-]+)/?$ index.php?part=$1&category=$2
    RewriteRule ^upcoming/([a-zA-Z0-9-]+)/category/([a-zA-Z0-9-]+)/?$ upcoming.php?part=upcoming&order=$1&category=$2
    ...
    RewriteRule ^rss/category/([a-zA-Z0-9-]+)/?$ rss.php?category=$1

    must be changed to:

    RewriteRule ^published/([a-zA-Z0-9-]+)/category/([a-zA-Z0-9_-]+)/?$ index.php?part=$1&category=$2
    RewriteRule ^upcoming/([a-zA-Z0-9-]+)/category/([a-zA-Z0-9_-]+)/?$ upcoming.php?part=upcoming&order=$1&category=$2
    ...
    RewriteRule ^rss/category/([a-zA-Z0-9_-]+)/?$ rss.php?category=$1

    (I have added the '_' symbol to the regular expression match for category.)

  2. #2
    Mayor of PliggVille/Coder AshDigg's Avatar
    Joined
    Dec 2005
    Posts
    1,515
    Thanks
    Received:0
    Given: 0
    Thanks, this has been added to the SVN. SourceForge.net Repository - [pligg] Revision 1520

  3. #3
    New Pligger lazyleo's Avatar
    Joined
    Dec 2007
    Posts
    2
    Thanks
    Received:0
    Given: 0
    Thanks mate appreciate it

Similar Threads

  1. Automatically add category/story rewrite rules to .htaccess
    By warefare in forum Questions & Comments
    Replies: 1
    Last Post: 07-29-2009, 10:46 PM
  2. Tags, tag range and .htaccess rewrite on URL Method 2
    By Type40 in forum Questions & Comments
    Replies: 6
    Last Post: 10-12-2008, 10:31 PM
  3. htaccess URL rewrite
    By webfinity in forum Questions & Comments
    Replies: 1
    Last Post: 03-21-2008, 08:53 PM
  4. Category htaccess mod rewrite output ordering
    By mspainhower in forum Questions & Comments
    Replies: 2
    Last Post: 05-13-2007, 03:56 PM
  5. Rewrite '&' category?
    By treelovinhippie in forum Questions & Comments
    Replies: 1
    Last Post: 04-22-2007, 10:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg