Hello I’ve bee trying for 1 week now to fix some urls on my custom built site but I can’t accomplish what I want 100%. So here is my question:
I have a php landing page that manages events the default url structure is this:
foreach($resultSet as $key => $event)
{
echo '<a href="/event.php?eid='.$event['eid'].'&cat='.$event['categroy'].'&title='.urlencode($event['title']).'">content</a>';
}
As you can see the url format is like this
/event.php?eid=145&cat=metal&title=Great+gig
What I would like it to be through htaccess is something like this
domain.com/event/metal/Great gig
I’ve been reading htaccess guides but I cant make it work with more tahn 1 params on the url please advise, Thank you.
Change your php code so that it generates URLs that look like
domain.com/event/metal/Great gig:(Note that the
'category'is mispelled in your example)Add these rules in the htaccess file in your document root, preferably above any rules you may have already there:
Additionally, if you have links that are out of your control that still have the query string, you can add these rules: