获取URL
通过$_SERVER['REQUEST_URI']
来获取请求路径
index.php隐藏
apache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
nginx
location \ {
try_files $uri $uri/ /index.php?$args;
}