Open westonruter opened 5 years ago
This should also work for /wp-login.php
as well.
It turns out that a plugin will not suffice for redirecting this or for redirecting /wp-admin/index.php
because the presence of .php
causes Nginx to not route through WordPress:
At the moment if I try going to such a PHP file URL, I get:
File not found.
It seems that the config file should include the following in that location
directive to ensure that *.php
URLs would get routed to WordPress for 404 nadling:
if ( ! -f $request_filename ) {
break;
}
I think we don't need to go overboard with this. Redirecting the specific /wp-admin/
URL will be the most important benefit I believe as this is the URL many people remember and just type. I doubt people often enter things like /wp-admin/options-general.php
directly, unless it was stored in their browser history in which case the URL should be correct already.
I agree we should fix this even more comprehensively by adjusting the Nginx config if possible. But if doing so, we should fix that problem specifically IMO instead of tweaking existing rules that might cause other side effects. I wonder whether it's possible to read the .env
or wp-cli.yml
file from Nginx.
I opened #18 for the MU plugin. We could then follow up on the rest separately.
My muscle memory is strong for going to
/wp-admin/
to access the admin. We should add a redirect to make it easier to access the admin.