PHP script file index.php hidden entrance

First, under nginx
When the entrance hidden files, configuration nginx nginx pathinfo must first open mode:
location ~ \ .php {# $ removed
root E:/phpStudy/WWW/tp/public/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
The following URL rewriting request specified path is the path project
location /server/admin/web/ {
if (!-e $request_filename) {
rewrite ^/server/admin/web/(.*)$ /server/admin/web/index.php/$1;
}
}
 
Two, Apache
Under Windows are generally open area opened apache rewrite module. If not, then change the next httpd.conf file.
index.php at the same level, the establishment of .htaccess files
Follows
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

Guess you like

Origin www.cnblogs.com/fwqblogs/p/11237449.html