mode_rewrite and .htaccess

Discussion in 'Apache' started by c4cyber, Oct 25, 2007.

  1. #1
    Hi !
    i need help related to mod_rewrite by .htaccess

    the scenario is

    dynamic url : localhost/cylinks/cat.php?id=4
    static url : localhost/cylinks/cat/id/4

    .htaccess file is saved in root directory (where index.php & cat.php exists)

    .htaccess contains::

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /


    # Set the default handler
    DirectoryIndex index.php

    # URL rewrite rules
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    ## Category redirect
    RewriteRule ^cylinks/cat/id/(.*)/$ /cat.php?id=$1 [L]
    </IfModule>


    but i'm getting 404 not found error.
    what's the problem ?
    please help ?
    i'm using apache 1.3.x ..
    is there any way to check if actually mod_rewrite module is working at my host/pc ?
     
    c4cyber, Oct 25, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^cylinks/cat/id/([^.]+)$ cylinks/cat.php?id=$1 [L]

    domain.com instead of localhost.
     
    Nintendo, Oct 25, 2007 IP
  3. c4cyber

    c4cyber Well-Known Member

    Messages:
    1,040
    Likes Received:
    27
    Best Answers:
    1
    Trophy Points:
    150
    #3
    Thankyou so much ! it's working now..
    but is it possible to do it on localhost ?
     
    c4cyber, Oct 25, 2007 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    localhost is worthless for mod_rewrite cause search engines would never even see it.
     
    Nintendo, Oct 25, 2007 IP