Running WP in a subdirectory nginx, wp-admin too many redirects

Hey all,

I was able to get this running by doing the following:

  1. Create a new site. Even though this worked on both Preferred and Custom, I recommend using Custom for this setup that way you can tweak the nginx/Apache configs if needed.
  2. Browse to the site’s app/public folder
  3. Create a folder named wordpress
  4. Move all of the files into wordpress except for index.php.
  5. Copy index.php into wordpress
  6. Open up index.php in app/public and adjust the require() call to include wordpress so it looks something like require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );
  7. Use Adminer or Sequel Pro to edit the siteurl option in wp_options to include /wordpress
  8. Test the site! Make sure you hard refresh by pressing Cmd + Shift + R

I tested the site frontend, admin, login, and customizer with HTTPS and didn’t run into any problems.

4 Likes