help with url rewrite

Discussion in 'Programming' started by izlik, Jun 13, 2010.

  1. #1
    Hello

    I have some trouble with url rewrite i hope someone can help me with.

    i have the following in my .htaccess file

    RewriteEngine on
    RewriteRule ^/([0-9]+)$ /loops.php/$1/

    and each time i go to my domain.com/1 it's saying that the link is broken and wont redirect, HOWEVER. if i insteed put the following in there it works, why is that ??

    RewriteEngine on
    RewriteRule ^test/$ /loops.php
     
    izlik, Jun 13, 2010 IP
  2. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #2
    You can't have a directory after a file?
     
    Pudge1, Jun 13, 2010 IP
  3. lukeg32

    lukeg32 Peon

    Messages:
    645
    Likes Received:
    19
    Best Answers:
    1
    Trophy Points:
    0
    #3
    of course you can!!! Its a redirect!!

    What is the path you are redirecting from the original? $test/[...] is not the same as the original redirect.
     
    lukeg32, Jun 14, 2010 IP