我有一个PHP项目,但它显示在实时服务器500错误。
项目结构看起来像这样,
主页 - 它包含两个子文件夹的主文件夹 管理员1 2. admin 2
在URL中不显示PHP扩展
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^(?!404\.html)$ - [L,NC,R=404]
</IfModule>
RewriteOptions inherit
ErrorDocument 404 /404.php
RewriteEngine on
### START WWW & HTTPS
# ensure www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
#RewriteCond %{HTTPS} off
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
### END WWW & HTTPS
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule ^(?!404\.html)$ - [L,NC,R=404]
答案 0 :(得分:0)
尝试此删除php扩展
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]