php how to configure the pseudo-static .htaccess file into pseudo-static files nginx

  php usually set pseudo-static three cases, .htaccess file, nginx pseudo-static file, Web.Config file was in the form of how three kinds of pseudo-static applied to the project yet,

1, .htaccess file example

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
RewriteCond %{http_host} ^96net.com.cn [NC]
RewriteRule ^(.*)$ http://www.96net.com.cn/$1 [L,R=301]
</IfModule>

2, nginx pseudo-static files example

server {
listen 80;
server_name v1.ywwfx.com;
root /home/www/v1.ywwfx.com;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

location / {
index index.php index.html index.htm;
if (!-e $request_filename) {
     rewrite ^/(.*)$ /index.php?s=$1 last; #隐藏index.php
}
}

}

3, Web.Config file

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="OrgPage" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(.*)$" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

In the course of the project application was, we must look good run environmental projects.

Guess you like

Origin www.cnblogs.com/96net/p/10927033.html