Nginx pseudo-static writing objective: to set zonggang. php? Shuhao = 130 rewrite to read/130
In the previous Windows Server, appserv is used. in this case, it is OK:
RewriteRule ^ /? Read/([0-9] +) zonggang. php? Shuhao = $1
Now I have changed the liunx and found the conversion method on the Internet using the nginx server.
Rewrite ^ /? Read/([0-9] +) $ zonggang. php? Shuhao = $1 last;
The error 404 is returned. could you tell me if there is a problem with my writing?
Reply to discussion (solution)
To rewrite to read/130, you need to enable the path_info mode. have you done it?
To rewrite to read/130, you need to enable the path_info mode. have you done it?
Path_info mode enabled
Create a file
Show. php
Echo $ _ SERVER ['path _ info'];
Run
Http: // servername/show. php/a/B/c/d
With this method, the result/a/B/c/d is obtained.
Rewrite ^ /? Read/([0-9] +) $ zonggang. php? Shuhao = $1 last;
Rewrite ^ /? Read/([0-9] +) $ zonggang. php? Shuhao = $1 last;
Or 404. it's really strange.
I got it done, but I still wrote an error about the static rule. I found a conversion tool.
Rewrite ^ /? Read/([0-9] +)/zonggang. php? Shuhao = $1;