Mod_Rewrite Help Please

Discussion in 'Apache' started by LeetPCUser, Feb 8, 2007.

  1. #1
    I need some help figuring out what to put in an htaccess file. My friend and I are baffled how to do this.

    Firstly, the site is http://bln.breakpointdesigns.com/

    When going here http://bln.breakpointdesigns.com/news/news.php you are given the archive months. When clicked we want a mod_rewrite on the file.

    Currently it is http://bln.breakpointdesigns.com/news/news.php?art=monat&zeit=200701 and we want it to be http://bln.breakpointdesigns.com/news.2007.01.php. The problem we are having is trying to get it to redirect and splitting up the 2007 and 01.

    Also, we are going to have to do this for the articles, but I am sure if I can get help with this one I will be set.

    Thanks.
     
    LeetPCUser, Feb 8, 2007 IP
  2. rodney88

    rodney88 Guest

    Messages:
    480
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RewriteEngine On
    RewriteRule ^news\.([0-9]{4})\.([0-9]{2})\.php$ news/news.php?art=monat&zeit=$1$2 [L,QSA]
    Code (markup):
    Something like that?
     
    rodney88, Feb 8, 2007 IP
  3. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks I was able to figure it out :)
     
    LeetPCUser, Feb 13, 2007 IP
  4. futurete

    futurete Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Does that mod_rewrite example go in the .htaccess?
     
    futurete, Feb 13, 2007 IP
  5. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes it does go into htaccess.
     
    LeetPCUser, Feb 14, 2007 IP