Need help with htaccess - tailing slash problem...

Discussion in 'Apache' started by nastynappy, Jul 10, 2008.

  1. #1
    hello, I am facing a problem here..
    my htacess file :
    # Rewrite URLs
    <ifmodule mod_rewrite.c>

    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(search)\/(.*)$ index.php?act=$1&keyword=$2 [L,QSA]
    </ifmodule>

    it works fine when I use "http://localhost/search/" or "http://localhost/search/john", but not when i use "http://localhost/search", notice the tailing slash gone, it gives a 404 error.
    Please help me ! I really need help!

    Thanks
     
    nastynappy, Jul 10, 2008 IP
  2. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #2
    Add another rule below the first one, that will look something like this:
    RewriteRule ^search$ index.php?blahblah [L]
    Code (markup):
     
    pr0t0n, Jul 11, 2008 IP
  3. nastynappy

    nastynappy Banned

    Messages:
    499
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    already sorted it out myself..
    forgot to get this thread closed..
     
    nastynappy, Jul 13, 2008 IP