mod rewrite question

Discussion in 'PHP' started by baris22, Jan 14, 2008.

  1. #1
    Hello,

    What is the difference between two?

    
    RewriteRule ^video-(.*)-(.*).htm$ video.php?vid=$1 [L,NC]
    
    PHP:
    
    RewriteRule ^video-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).htm$ video.php?vid=$1 [L,NC]
    
    PHP:
    thanks
     
    baris22, Jan 14, 2008 IP
  2. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The first one operates on URLs of the format:

    video-xx-xx.htm

    While the second one operates on URLs of the format:

    video-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx.htm

    Actually, the way the regexps are written, the first one would really accept any URL that the second one would, while the reverse is not true.

    Both RewriteRules are poorly written.
     
    SmallPotatoes, Jan 14, 2008 IP