Jump to content


Photo

mod rewrite


  • Please log in to reply
2 replies to this topic

#1 sploit

sploit
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 07 December 2005 - 10:35 AM

hi,

i have a url like:
mysite.com/show.php?catid=1&catname=clothing

can i rewrite it as
mysite.com/clothing/
?



#2 tiki

tiki
  • Members
  • PipPipPip
  • Advanced Member
  • 45 posts

Posted 08 December 2005 - 06:08 AM

RewriteEngine On
RewriteRule ^([a-z]+)/$ show.php?catid=1&catname=$1

Should do it, but it might not work do to you having cat with 2 variables, better to put id/name in an array as

'1 => Clothing'

#3 bon

bon
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 21 January 2006 - 08:39 AM

Sploit, tiki forgot to mention you have to put that code into your .htaccess file.

If you don't know how to do that, check out [a href=\"http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html\" target=\"_blank\"]http://www.yourhtmlsource.com/sitemanageme...lrewriting.html[/a]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users