Pseudo-statics are used in many programs. Here is a unified record of the method of operation.
Apache pseudo-static configuration:
A) PHP configuration
vim /etc/php.ini cgi.fix_pathinfo = 1 #Remove comments
B) apache configuration
vim /etc/httpd/conf/httpd.conf LoadModule rewrite_module modules/mod_rewrite.so #Remove this comment. <Directory /> Options FollowSymLinks AllowOverride None </Directory> #Change the None of AllowOverride to All service httpd restart #Restart apache
Nginx pseudo-static configuration
vim /etc/nginx/conf.d/default.conf location / { root / var / www / html; index index.html index.htm index.php; } #Add the pseudo-static rules of their respective programs here, such as thinkphp's pseudo-static rules are as follows location / { root / var / www / html; index index.html index.htm index.php; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } } service nginx restart #Restart nginx
In this way, pseudo-static takes effect!