Jump to content


Photo

Mod Rewrite Help


  • Please log in to reply
No replies to this topic

#1 jgd12345

jgd12345
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 29 December 2005 - 06:18 PM

Hi, i'm useless at regular expressions and having trouble implement mod_rewrite to make my site search engine friendly. The url I want to rewrite is:

/products/index.php?category_id=$cid(&page=$page)?

to:

/products/[a-zA-Z0-9-/]*/([0-9]+)$/? (something like this - i've read alot of tutorials but can't get my head around it)

eg

/products/cat-1/subcat-1/subcat-2/12/ or
/products/cat-1/subcat-1/subcat-2/12 (with or without the ending slash) or
/products/cat-1/subcat-1/subcat-2/12/1 (including the page number - again with or without the ending slash)

note: the 12 is the category_id and the 1 is the page

and:

/products/product.php?product_id=$pid

to:

/products/cat-1/subcat-1/subcat-2/product-name/19 (again with or without the ending slash)

note: the 19 is the product_id.

Would appreciate it if someone could help. Thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users