How to rewrite my url?

Discussion in 'PHP' started by windflow, Nov 5, 2009.

  1. #1
    windflow, Nov 5, 2009 IP
  2. emed

    emed Peon

    Messages:
    70
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    this would be the htaccess to capture the url:
    RewriteEngine On
    RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /?year=$1&month=$2&title=$3 [L]
    Code (markup):
    to generate the urls you have to modify your blog/web/w/e to do something like this:
    <?php
    echo "<a href='http://example.com/$var_year/$var_month/$var_title'>$var_title</a>";
    ?>
    PHP:
    just an example, it depends on what software you use
     
    emed, Nov 6, 2009 IP
  3. techethos

    techethos Peon

    Messages:
    89
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    techethos, Nov 9, 2009 IP