Issue Summary
My .htaccess rules work fine on our live server, but I get a 500 server error on Local
Troubleshooting Questions
-
Haven’t tested on other sites, but I suspect it would happen with all of them
-
Are you able to create a new, plain WordPress site in Local and access it in a Browser?
Replication
- Spin up a WordPress website with local
- Migrate the site to a live web host
- Add the HTACCESS rules I have provided
- Observe that the SSL padlock shows up fine with no errors on the live site
- Observe the exact same HTACCESS rules causing “500 Internal Server Error” on Local
<IfModule ssl_module>
RewriteEngine On
RewriteCond %{HTTPS} !=on
Header always set Content-Security-Policy "upgrade-insecure-requests;"
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
</IfModule>
System Details
- Which version of Local is being used?
7.0.2+6395
- Windows 10 64-bit
- PHP: 8.1.9
- Web Server: Apache 2.4.43
- Database: MySQL 8.0.16
- Attach the Local Log.
local-logs.zip (14.2 KB)
Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.