I am trying to do following rewrite rule on my wordpress page.
I have a page www.mydomain.com/videa
and I want to configure it in the way, when someone types www.mydomain.com/videa/some-string
it will be rewrited (not redirected) to www.mydomain.com/videa/?v=some-string
but the user will still see his URL www.mydomain.com/videa/some-string
.
We are running Nginx server, i tried following rule rewrite "^/videa/(.+)$" "/videa/?v=$1";
but it keeps saying page not found.
Thank you for your help in advance.
I believe in this case you are trying to add extra variables to an existing WordPress page, so something like this should work:
You can put that into your themes
functions.php
or create a plugin it. You’ll need to flush you rewrite rules by re-saving permalinks in the WordPress admin interface.Try “re-saving” the Permalinks settings from the dashboard after you do the change (/wp-admin/options-permalink.php). Sometimes it fixes the issue.