我收到 proxy_fcgi:error] AH01071: 经常出现“主脚本未知”错误。谁能告诉我是什么导致了这个错误。到目前为止我了解到的是重写规则可能会导致这个问题。但不明白到底是什么原因导致了这个问题。以下是我的重写规则:
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory /var/www/>
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride None
Require all granted
# Setting rewrite rules
RewriteEngine on
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule (.*) https://www.example.com/$1 [R=301,L]
# Show 404 error if there is any slash after page name
RewriteRule ^.+?\.(php|html?)/ - [L,R=404,NC]
# Custom Directory Index Files
DirectoryIndex index.php index.html
</Directory>
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory /var/www/>
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride None
Require all granted
# Setting rewrite rules
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule (.*) https://www.example.com/$1 [R=301,L]
# Show 404 error if there is any slash after page name
RewriteRule ^.+?\.(php|html?)/ - [L,R=404,NC]
# Custom Directory Index Files
DirectoryIndex index.php index.html
</Directory>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
</IfModule>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21404 次 |
| 最近记录: |