Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

htaccess rewrite rule for page/title in wordpress?

I am creating one little plugin for WordPress which is about trips. I am now at the point to create a browse page where to be opened each trip.

My idea is this -
I have created http://example.com/?page_id=143

And i want at my site users to open page as : http://example.com/trip/NAME

Can someone help me with the rewrite url? because I am very weak on rewriting..

like image 784
Svetoslav Avatar asked Feb 22 '23 10:02

Svetoslav


1 Answers

Put this before your wordpress rules and after the RewriteEngine On

RewriteRule ^trip/([a-z0-9\-_]+)/?$ index.php?page_id=143&name=$1 [NC,L]
like image 135
Book Of Zeus Avatar answered Feb 27 '23 03:02

Book Of Zeus