need help with .htaccess

Discussion in 'Apache' started by young coder, Jul 4, 2008.

  1. #1
    hi all

    I need help with .htaccess file I need to make this
    by example If the link is
    digitalpoint.com/main/test/test2/test3
    I want it to open all the red text like this
    digitalpoint.com/main/index.php?id=test/test2/test3

    whatever after main ( if it have more than one "\" , "-" , "=" , numbers or anything ) it open
    digitalpoint.com/main/index.php?id=(and put it all here )

    so how can I make this ?
     
    young coder, Jul 4, 2008 IP
  2. innoxed

    innoxed Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RewriteRule ^(.+)/(.+)/(.+)/$ /index.php?$1/$2/$3 [L] should work I guess?
     
    innoxed, Jul 4, 2008 IP
  3. young coder

    young coder Peon

    Messages:
    302
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    no , I mean it may be "test/test2/test3" and may be "test/" and maybe "test/test2/test3/test/test2/test3" not only three

    and I solved it . it is

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?link=$1 [L]

    it accept anything like "test/test/test" or "test/test" unlimited "/" folders :)
    that allow anything like / , * and .(dot)
    without
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    it don't work :( and i don't know why

    anybody explain ?
     
    young coder, Jul 4, 2008 IP