# Can't gfigure out .htaccess

**URL:** <https://forum.kirupa.com/t/cant-gfigure-out-htaccess/310038>\
**Category:** Uncategorized\
**Created:** [May 31, 2010, 6:53am UTC](https://forum.kirupa.com/t/cant-gfigure-out-htaccess/310038 "2010-05-31T06:53:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![forza\_stiinta](https://avatars.discourse-cdn.com/v4/letter/f/bc79bd/32.png) [@forza\_stiinta](https://forum.kirupa.com/u/forza_stiinta)\
**Post date:** [May 31, 2010, 6:53am UTC](https://forum.kirupa.com/t/cant-gfigure-out-htaccess/310038/1 "2010-05-31T06:53:02Z")

</div>

Hello

I have the following .htaccess code

```auto
RewriteRule ^categorie/(.+)-(.+)-p(.+).html$ categorie.php?cat_id=$2&current_page=$3 [L]
RewriteRule ^categorie/(.+)-(.+).html$ categorie.php?cat_id=$2 [L]

```

I want to pass the id of the category as the last part of the url just before .html. For some links it works but for some, it does not, and I cannot figure out why.

For example, this works: [www.mysite.com/categorie/am-mp3-auto-27.html](http://www.mysite.com/categorie/am-mp3-auto-27.html) (it passes 27 as get parameter)

But this does not: [www.mysite.com/categorie/cd-mp3-playere-auto-25.html](http://www.mysite.com/categorie/cd-mp3-playere-auto-25.html) (it passes mp3 as get parameter)

If I open [www.mysite.com/categorie/cd-mp3-playere-auto-25-p2.html](http://www.mysite.com/categorie/cd-mp3-playere-auto-25-p2.html) (p2 sais it is the 2nd page), it works.

Please advise.  
Thank you
