SEO friendly URLs

  • biggie
  • Novice
  • Novice
  • biggie
  • Posts: 18
  • Loc: UK

Post 3+ Months Ago

Hi all,

I am developing an online shop and struggling to construct SEO friendly links.

I currently have a products.php page which depending upon the id passed in the url returns a different list of products from the database:

The shopper then selects a specific product from the list which passes another variable to the items.php page:

I want to use mode_rewrite and .htaccess to rewrite these urls to something like:

Is this possible and how would i go about doing this? Ive searched many .htaccess tutorials but i am still unclear if i am structuring my links correctly?

thanks for help with this.

  • NagudNasorum
  • Born
  • Born
  • NagudNasorum
  • Posts: 3
  • Loc: Iasi

Post 3+ Months Ago

Code: [ Select ]
<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_URI} !-f
    RewriteCond %{REQUEST_URI} !-d
    RewriteCond %{REQUEST_URI} !-s
    RewriteRule ^products/([^/]+)/([^/]+)/([0-9])/?$   /products.php?id=$3 [L]
  1. <IfModule mod_rewrite.c>
  3.     Options +FollowSymLinks
  4.     RewriteEngine on
  5.     RewriteBase /
  7.     RewriteCond %{REQUEST_URI} !-f
  8.     RewriteCond %{REQUEST_URI} !-d
  9.     RewriteCond %{REQUEST_URI} !-s
  11.     RewriteRule ^products/([^/]+)/([^/]+)/([0-9])/?$   /products.php?id=$3 [L]
  12. </IfModule>

And you can access you like like that: (where 56 is the product ID)

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 40 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.