Menu code:
<a href="/category/<?=$cat_name['id']?>/<?=simpleURI($cat_name['catname'])?>/" title="<?=ucfirst($cat_name['catname']); ?>">Level 1</a>
<a href="/category/<?=$subcat_name['id']?>/<?=simpleURI($cat_name['catname'])?>/<?=simpleURI($subcat_name['catname'])?>/" title="<?=ucfirst($subcat_name['catname']); ?>">Level 2</a>
<a href="/category/<?=$subcat_name1['id']?>/<?=simpleURI($cat_name['catname'])?>/<?=simpleURI($subcat_name['catname'])?>/<?=simpleURI($subcat_name1['catname'])?>/" title="<?=ucfirst($subcat_name1['catname']); ?>">Level 3</a>
<a href="/category/<?=$subcat_name2['id']?>/<?=simpleURI($cat_name['catname'])?>/<?=simpleURI($subcat_name['catname'])?>/<?=simpleURI($subcat_name1['catname'])?>`/<?=simpleURI($subcat_name2['catname'])?>/" title="<?=ucfirst($subcat_name2['catname']); ?>">Level 4</a>
Current mod working fine on /category/18/cat-name-level/cat-name-level2/
Here is my .htaccess:
RewriteRule ^category/([0-9]+)(?:/([^/]+)(?:/([^/]+))?)(?:/([^/]+)(?:/([^/]+))?)?/$ ./category.php?pid=$1 [QSA,L]
The problem, we can type anything after the ID:
/category/18/yehahh/jsidfd/
/category/18/jkasjksd/dhgidg/ondsg/djgn/
How to fix it?