Hello the problem I’m having is this, I have a landing page (event.php) that shows events from my DB.
Each event among other fields has ‘category’,’title’,’id’. I’m trying to create clean urls for my website that will look like this http://domain.com/event/category/title but the problem is that some events might have the same title because they might repeat weekly or so, altho they do have unique id, which I use to get the specific event.
My question is this, how could I transform something like:
http://www.domain.com/event.php?cat=rock&title=Great-gig&id=145
into:
http://www.domain.com/event/rock/Great-gig
Keep in mind that I do need the value of id but I dont want it to be shown on the clean url somehow…
I can create clean urls with htaccess but I can’t figure out how to exclude the id from being seen.
Thank you.
You have 2 options only:
make an alias, for example, Great-gig-Dec if the event in december, Great-gig-Jan if it is in January and use this value as your unique id
load only the next event, or the most recent event, depending on your structure of site. This way if there are more than one Great-gig then you get the latest or the next, so you can structure your url like http://www.domain.com/next-events/rock/Great-gig, http://www.domain.com/latest-events/rock/Great-gig . So here you know which one of the many rows to use while it still looks like a good url.
maxim