I want to install a new WordPress in a subdirectory

mydomain.com [default WordPress site], mydomain.com/learn [subdirectory WordPress site]

I've tried using Subdirectory binding and it worked until I entered admin, after I opened the post link a 404 occurred and the URL pointed to mydomain.com instead of mydomain.com/learn.

Please tell me how to set it up, I am using Nginx, Are there any rules for Nginx to work properly?

    aaPanel_Kern

    I've done that sir.

    The problem is that if the permalink structure is %postname% it will point to the main domain not a subdir

      It is recommended to check whether your site configuration file is configured correctly?
      Personally, it is recommended that you create a new site directly, and the directory of the site points to the same directory.

      darapati17

        aaPanel_Kern

        Yes, it's the same directory, sir

        Like this:
        www/wwwroot/mysites.com (main site uses WordPress)
        www/wwwroot/mysites.com/blog (directory site uses WordPress)

        I installed WordPress in a directory using the subdirectory binding in the panel, everything runs normally and can be accessed.

        But when I change the permalink structure to %postname% in the subdir the link in the post will be directed to the main domain and not found.

        for example like this:

        mysites.com/blog/how-to-use-aapanel

        When clicked it will redirect to the main domain and it is not found, it should remain in the subdir

          You should use the domain name that binds the subdirectory to access.
          This is the domain name jump of the main site

          darapati17


            You should use the added domain name to access your subdirectory bindings
            Such as: 113wp.com

              9 months later