WordPress.org

Make WordPress Core

Opened 6 weeks ago

Last modified 6 weeks ago

#42095 new defect (bug)

Loop Error with WordPress.org Multisite

Reported by: sma27 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.2
Component: General Keywords: reporter-feedback
Focuses: Cc:

Description

This write up (see link below) outlines the exact issue I encountered. Basically any bad URL which should result in a 404 error instead causes a 500 error. I discovered this issue using the web master tools in Google as missing images were resulting in an Internal Server Error instead of a 404 error.

The fix was a simple edit to the .htaccess file (refer to the blog post below).

https://rob006.net/en/blog/wordpress-multisite-a-rewrite-infinite-loop-bug/

Change History (4)

#1 @sma27
6 weeks ago

P.S. I am using PHP 7.1 and Apache 2.4.

#2 @jeremyfelt
6 weeks ago

  • Keywords reporter-feedback added

Hi @sma27, thanks for opening a ticket. Can you provide more details on the configuration of your WordPress install?

From the writeup, it sounds like a URL such as http://rob006.net/en/wp-content/file.jpg is expected, but the URLs are being generated without the /en/.

Is this a subdirectory configuration and is /en/ another site on the network or is WordPress being loaded from the /en/ subdirectory? If you don't mind, it'd be helpful to see your related multisite constants in wp-config.php and to know whether any related plugins are activated that might be affecting rewrites in some way.

#3 @sma27
6 weeks ago

Here is a production example:

https://marriottschool.byu.edu/ballard/about/overview/melvin-j-ballard/

If I grab the url for the picture it is:

https://marriottschool.byu.edu/ballard/wp-content/uploads/sites/6/2015/05/mjb1.png

Any modification to that URL other than the file name would result in the 500 error. However, I've applied the fix outlined in the blog post I included so it will display a 404 now.

So these would result in a 500 error:

https://marriottschool.byu.edu/ballard/wp-content/uploads/sites/6/2015/059/mjb1.png
https://marriottschool.byu.edu/ballard/wp-content/uploads/sites/6/22015/05/mjb1.png
https://marriottschool.byu.edu/ballard/wp-content/uploads/sites/16/2015/05/mjb1.png
https://marriottschool.byu.edu/ballard/wp-content/uploads/sites2/6/2015/05/mjb1.png
...

Does that make sense? Changing any of the paths to be wrong would result in a 500 error. However if I modified the image name like:

https://marriottschool.byu.edu/ballard/wp-content/uploads/sites/6/2015/05/mjb1222222.png

It would report a 404 still as long as the path portion was correct.

Thanks

#4 @sma27
6 weeks ago

The comment at the bottom of the post mentions the following:

Amazing, thank you very much Robert for this post – it helps me alot!
I have searched for the answer more than 5 hours all over the internet and tried almost everything, and only your decision worked – like charm. 🙂
By the way, I get this error on my multisite platform only when enabled https (ssl certificate). Without ssl, even with using “?” symbol I didn’t have problems.

*

We do have ssl enabled.

Note: See TracTickets for help on using tickets.