SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    seo friendly links

    Hi..i originally posted this in the wrong forum for what i wanted to achieve, so here goes....

    I have changed the htaccess file so this;
    HTML Code:
    website.com/whatson.php?event_id=1&cat_name=comedy&event_name=some ones name
    changes to this;
    HTML Code:
    website.com/whatson/1-some ones name.html
    using:
    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    rewriterule ^whatson/([^-]+)-([^&]+)\.html$ /whatson.php?event_id=$1&cat_name=$2&event_name=$3 [L]
    </IfModule>
    One thing that i cant get my head around (and yes, ive been searching around for the last few days!)....what php code do i need to have to change the actual links in my webpage (below) to a seo friendly link?

    Code:
    <a href="whatson.php<?php echo $row_main['event_id']; ?>&amp;cat_name=<?php echo $row_main['cat']; ?> &amp;event_name=<?php echo $row_main['eventname']; ?>"
    ....then obvioulsy i then need to change the values again for a mysql query (maybe this would be part 2 of the question!)

    ...i hope someone could literally spell it out for me...thanks in advance

  2. #2
    SitePoint Evangelist
    Join Date
    Mar 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry...just a gentle bumpy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •