i wanna use clean url for my site but i have an big problem! i have urls like :
index.php?lang=en&mod=product§ion=category
index.php?lang=en&mod=product&caption=fetch&id=45
index.php?lang=pe&mod=blog§ion=category&id=560
index.php?lang=pe&mod=blog§ion=category&id=564
index.php?lang=pe&mod=blog§ion=category&id=567
index.php?lang=pe&mod=blog§ion=category&id=571
index.php?lang=pe&mod=blog&id=556
index.php?lang=pe&mod=page&id=537
index.php?lang=pe&mod=blog&id=558&o_t=cDate_ASC
index.php?lang=pe&mod=product&caption=fetch&id=7804
As you see i have a problem that my varibale's order is diference toghether and my 3rd or 4th variable are not stable sometimes it's id or sometimes is caption. i want to set my template url to ( e.g en/product/category ) but when i want to set it in .htaccess it's not clear that theird depth is "id" or is "caption" !
do i should put all variables in my url like this ? :
index.php?lang=en&mod=product§ion=category
|
|
|
V
index.php?lang=en&mod=product§ion=category&caption=&id=&o_t=&v_t=&offset=
EDIT :
So i use smarty as my template engine.i should change my link address in templates like my clean url ( e.g en/product/category/324 ) . my problem is when i set a link to en/product/34 or en/product/category/23 according to my .htaccess rewrite rules it's not clear that 3rd part is id or category
in this case :
RewriteRule ^/(en|pe)/(product|blog|page)/(category)/([0-9]{1,})/$ index.php?lang=$1&mod=$2§ion=$3&id=$4
3rd variable is category an .htaccess define 3rd part as category but as you can see sometimes url has not category and instead of it has id ! My big problem is this