Windwos
找到 httpd.conf
AllowOverride None改为
AllowOverride All
在web根目录添加文件.htaccess
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] RewriteRule ^hehe/$ index.php/$1 [QSA,PT,L]重启Apache
ok了
linux ngnix
找到nginx.conf文件
在文件内随意地方添加
include 文件路径/rewrite.nginx
rewrite ^(.*)$ index.php last; rewrite ^/haha$ /index.php last;
重启 nginx
ok了