odd behavior with default rewrite rules
-
Here are the default multisite rules for Apache.
RewriteRule ^index\.php$ - [L] RewriteRule ^wp-admin$ wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^(wp-(content|admin|includes).*) $1 [L] RewriteRule ^(.*\.php)$ $1 [L] RewriteRule . index.php [L]
If I pass to the server https://wordpress-site.com/dummy.php, I get back a page saying
File not found.
But if I pass to the server https://wordpress-site.com/dummy/dummy.php, I get back a page saying
Internal Server Error
which according to the logs is the result of too many internal redirects.
If I change RewriteRule ^(.*\.php)$ $1 [L] to RewriteRule ^(.*\.php)$ – [L], then the Internal Server Error gets replaced by Apache’s “Not Found” page.
1) Where does the “File Not Found” page come from? I can’t find this string in this context anywhere in the WordPress installation.
2) Why does RewriteRule ^(.*\.php)$ $1 [L] give too many redirects whereas the RewriteRule ^(.*\.php)$ – [L] not do that?
3) Why is the behavior different at all between the two different URLs?
- The topic ‘odd behavior with default rewrite rules’ is closed to new replies.