[modrewrite] /? not working?

Discussion in 'Apache' started by noon, Dec 21, 2007.

  1. #1
    Here is my code
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^(.*) $1 [L]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(\w+)/?$ $1.php [R]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^smarty/(\w+)/?$ smarty/index.php?section=$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^smarty/demo/(\w+)/?$ smarty/demo.php?name=$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^smarty/demo/(\w+)/(\w+)/?$ smarty/demo.php?name=$1&source=$2 [L]
    Code (markup):
    When I do http://localhost/error, rule 2 picks up and redirects. When I do http://localhost/error/, I get a 403 error. I don't understand.

    Help appreciated,
     
    noon, Dec 21, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Try it on a REAL domain, instead of localhost.
     
    Nintendo, Dec 21, 2007 IP