Modifying mod-rewrite

How do I modify this:

RewriteRule ^([-a-zA-Z0-9_]+)/([a-z]+)/([-a-zA-Z0-9_]+)$ /index.php?go=$1&$2=$3 [L,QSA]

to do this conversion

site.com/pagename/categoryname/

site.com?go=pagename&contentid=categoryname

This was my attempt:
RewriteRule ^([-a-zA-Z0-9_]+)/([-a-zA-Z0-9_]+)$ /index.php?go=$1&contentid=$2 [L,QSA]

But its not working.

Thanks E

There is slash ending in site.com/pagename/categoryname/
But in your rewriterule it is missing. Try below one

RewriteRule ^([-a-zA-Z0-9_]+)/([-a-zA-Z0-9_]+)/$ /index.php?go=$1&contentid=$2 [L,QSA]

This might solve your problem

… then expect your relative linked support files (css, js, jpg, gif, etc) to be two directory levels off.

Regards,

DK