i am trying to make the URL in my PHP application cleaner using htaccess. Earlier the links of my application were in this format
http://localhost/25_2_april/video.php?cat_id=2&category=Programming-Language
, but with the help of htaccess i was able to convert it into
http://localhost/25_2_april/video-library/2/Programming-Language
. Now ,the question is that every time i run my application it loads the messy URL instead of the clean URL , although when i edit the url ,and make it clean url, then that works too. Now is there any way, that it directly loads the clean url instead of the messy url.
Below is the anchor tag through which i am calling this particular page.
<a href="<?php echo 'video.php?cat_id='.$cat_id.'&category='.$cat_name; ?>">
As you are adding static URL in html so must have to pass your clean URL as :
<a href="<?php echo 'http://localhost/25_2_april/video-library/'.$cat_id.'/'.$cat_name; ">