Passing a parameter to a permalink

I'm trying to create permalinks for a page that currently has parameters passed to it. The site was set up by somebody else and I'm not familiar with Wordpress

I have various pages which have URLs of the form /events/single-event/?u_name=event_name/ e.g. /events/single-event/?u_name=Hippy

I would like to be able to access these various pages via /something/event_name/ where I'm not too fussy about what something is. something can have a slash in it if required.

I've had a go at setting this up via RewriteRule in .htaccess but haven't had any luck.

Can someone suggest how I can achieve this?

Many thanks

Topic permalinks Wordpress parameter

Category Web


You don't have to mess with .htaccess since WordPress has it's own rewrite engine builti in. You are looking for this: https://codex.wordpress.org/Rewrite_API/add_rewrite_rule

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.