So I’m pulling events from the database such as /event-detail.php?id=1, but I want it to look like /Event-Name/ instead. How do I achieve this? I know a bit about mod Apache rewrite but not enough to know if it would work here. Or am I approaching this wrong? Do I need to pull items with name instead? /event-detail.php?name=Event Name? I don’t really want to do it that way even though it seems like it would be much easier.
So I’m pulling events from the database such as /event-detail.php?id=1 , but I want
Share
It would be very hard to make it work otherwise (I think).
Try this (write this to server conf or .htaccess):
That will rewrite urls and forward everything else than existing files and directories to
event-detail.phpscript.Bit more info, if user call’s
/myShowEvent1that will be rewritten asevent-detail.php?name=myShowEvent1or if user call’s/event/25366273that would be same as callingevent-detail.php?name=event/25366273(that is if they do not exists in the server).