Problem with RewriteRule...

Discussion in 'Apache' started by mahmood, Jan 9, 2008.

  1. #1
    I have a rewriterule like this:
    The problem is that the second part of the url - ie the "name" part - sometimes contain slash "/" and so I'll get "page not found" error. for example:

    am/234850/thisIsA/Name

    even url encode isn't working. What's the solution.
     
    mahmood, Jan 9, 2008 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 ^am/([^.]+)/([^.]+)/([^.]+)$ thePage.php?itemId=$1&name=$2 [L]
    RewriteRule ^am/([^.]+)/([^.]+)$ thePage.php?itemId=$1&name=$2 [L]

    might do it. Or make the script search and replace the / to something else, like a -
     
    Nintendo, Jan 10, 2008 IP
    Halobitt likes this.