3

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

1
  • You'll need to look at the link Bruno has provided, and consult that somebody because you'll later need to change $_GET['u_name'] to get_query_var assuming you have the rewrite rules applied.
    – Ismail
    Commented Jun 3, 2016 at 1:51

1 Answer 1

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.