mod_rewrite problems - 404 not found

Discussion in 'Apache' started by Chrilz, Sep 11, 2006.

  1. #1
    Hey all, i really hope that someone out there will be able to help me :).

    I have this site, where i would like to change category.php?category=$1 into /category/$1/

    I've tried this in my .htaccess file:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^/category/([0-9A-Za-z]+) category.php?category=$1
    </IfModule>

    Put then when i type in http://mydomain.tld/category/gang/ (ex.), i just get an, "the page could not be found" respons.

    Whats the error ? :s, mod_rewrite should be enabled, since i also run a wordpress blog on this webhosting, and i with out a problem can use the custom links build into wordpress. ex. http://site.tld/2006/09/09/headline/.

    Im looking forward to your answers ;).

    Greetings Christian.
     
    Chrilz, Sep 11, 2006 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^category/([^.]+)/$ category.php?category=$1 [L]
     
    Nintendo, Sep 11, 2006 IP
  3. majohnst

    majohnst Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Your apache error log should show the final url (after mod_write is applied) that is being requested.
     
    majohnst, Sep 12, 2006 IP
  4. Chrilz

    Chrilz Peon

    Messages:
    110
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I've made it work by using this code instead
    RewriteEngine on
    RewriteRule ^/?category/([0-9A-Za-z]+)$ category.php?category=$1 [L]
    :).

    But thanks anyway :).
     
    Chrilz, Sep 12, 2006 IP