Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey Ricardo,

    So you want to remove the permalinks right?
    Well, you should switch off the permalinks in WordPress
    and should also edit nginx.conf file to remove all redirection directives.

    Regards,
    Mayank

    Thread Starter rkleemann

    (@rkleemann)

    Hi,

    Actually I don’t want to remove the permalinks. I just want to understand how to “rewrite” them to a more readable format.

    I want to keep the underlying ?page_id=xx but to the user, a more readable format.

    So https://mydomain.com/mypage would translate to https://mydomain.com/?page_id=xx

    I’m not trying to get rid of the permalink but just “reformat” it via nginx.

    by default that’s how it works in WordPress.
    if you’ve switched on the permalinks and you’re using https://domain.com/?page_id=xx to open up a page – it’ll automatically redirect you to the pretty permalink of the page/post.

    Thread Starter rkleemann

    (@rkleemann)

    Maybe I’m not quite getting this, or I have it backwards…

    I want to be able to type in https://mydomain.com/mypage and have that mapped to https://mydomain.com/?page_id=xx

    Right now if I configure WP to use the permalink like that, when I type in https://mydomain.com/mypage I get a file not found error.

    As I understand it, I need to configure nginx to take a location request of /mypage/ and then translate it to the /?page_id=xx

    thanks for your patience with my ignorance ??

    no no, its fine you explained it correctly – its just that I couldnt’ figure that why would someone want to do it and thought that you were confused or something. My bad to assume this bit.. ??

    Although, I don’t see a use of it in terms of SEO & factors like it’ll load up server as well. It means two redirections for nginx rather it’ll put the it in indefinite loop..

    i.e. first nginx is doing ugly permalink to pretty permalink and then as per your requirement you want it to switch back to ugly permalink and most likely WP will try again to send it back to pretty permalink… as you can see this looks like indefinite loop.

    I highly doubt that it’ll be possible unless you decide to keep it one way.

    Thread Starter rkleemann

    (@rkleemann)

    Hmmm… so the standard WP way, using /?page_id=xx works out of the box.

    I don’t need to configure WP to use pretty permalinks. I can keep WP just doing the normal /?page_id=xx.

    The question is how do I configure nginx to point/translate “/mypage/” to /?page_id=xx?

    I’m looking for a static mapping. Like for example

    /mypage/ -> /?page_id=2

    Not trying to do anything fancy, and keeping WP as default and only doing the translation at nginx.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Help with permalinks on nginx’ is closed to new replies.