htaccess and query_string help

Discussion in 'Apache' started by damianinfo, Oct 29, 2006.

  1. #1
    Hi
    I am new to this .htaccess, I know with this .htaccess I can make query strings "search engine" friendly. if any one can help me how to do this will be a big help for me.

    I got a url as: mydomain.com/archive.php?y=2006&m=10

    all I need is to make it like mydomain.com/archive/2006/10 when I click a link
    ‘view-archive-2006-oct’ in my index.php page, Is it possible to do this redirecting in .htaccess?
     
    damianinfo, Oct 29, 2006 IP
  2. Fed

    Fed Peon

    Messages:
    19
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi, I think this code should be what you need
    
    RewriteEngine On
    RewriteRule ^/?archive/[0-9]+/[0-9]+/?$ archive.php?y=$1&m=$2 [L]
    
    Code (markup):
    I'm not 100% sure it works as I'm almost new to mod_rewrite as well, but I hope I'm right :)
     
    Fed, Oct 30, 2006 IP
  3. damianinfo

    damianinfo Member

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #3
    Hi
    I tryed this now and it did not work
     
    damianinfo, Oct 30, 2006 IP