htaccess help

htaccess help

Posted by: kiko08
Posted on: 2007-11-07 20:18:00

hello i have some problems with htaccess.
heres my current htaccess

RewriteEngine On
RewriteBase /

RewriteRule ^([^/]+).html$ /index.php?id=$1
RewriteRule ^([^/]+)/(.*).html$ /view.php?cat=$1&page=$2


it works when i have a url like
www.mysite.com/category/2.html

but i also want to make a page that has a url something like
www.mysite.com/category-2-1.html

with original url
www.mysite.com/viewitem.php?cat=category&page=2&item=2


whenever i use the url
www.mysite.com/category-2-1.html

it shows the page of
www.mysite.com/category-2.html
and disregarding the value of "item"

with my htaccess of
RewriteRule ^([^/]+)-(.*)-(.*).html$ /viewitem.php?cat=$1&page=$2&item=$3


can someone pls help me with this one?
thanks in advance.

Re: htaccess help

Posted by: Atropos7
Posted on: 2007-11-07 21:09:00

Try taking a cue from the first capture and be more specific:

RewriteRule ^([^/]+)-([^-]+)-(.*).html$ /viewitem.php?cat=$1&page=$2&item=$3





cool openvein.org -//-

Re: htaccess help

Posted by: kiko08
Posted on: 2007-11-07 22:37:00

thanks for the reply but i get 404 page error

Tags: htaccessrewriterulecat 1heres