Apache只需要在对应的.htaccess文件中写入
Options +MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L]
nginx服务器的话只需要加入到规则
location / { try_files $uri $uri/ $uri.php?$args; }
请登录已经激活账号继续浏此文章所有内容!