Please help me with .htaccess rewriterules!

Discussion in 'Apache' started by istvan89, Aug 20, 2011.

  1. #1
    Hello everybody, thanks for reading!
    I want to make my site to work with seo friendly urls.
    Lets say, the urls would work something like this:
    if user types
    http://mydomain.com/typed-page/argument-one/
    so in background apache would handle it as
    http://mydomain.com/typed-page.php?arg1=argument-one
    so after the domain name between slashes is the php filename, after that argument one.
    Anybody knows how to make this work? I'm really noob with rewriterules.
     
    Solved! View solution.
    istvan89, Aug 20, 2011 IP
  2. #2
    RewriteEngine on
    RewriteRule ^([^/]+)/([^/]+) $1?arg1=$2 [NC]
     
    seikoz, Aug 21, 2011 IP
  3. rndm

    rndm Greenhorn

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    There is a guy over at WW that goes by JDMorgan. read his posts, you'll learn everything you'll ever need to know. Just google jdmorgan rewrite
     
    rndm, Aug 21, 2011 IP
  4. istvan89

    istvan89 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    seikoz: your solution is almost perfect, just extended after $1 with .php to work, thank you very much:). rndm: thanks for the links, I'm checking it out right now!
     
    istvan89, Aug 21, 2011 IP