For NGINX pseudo-static, please refer to the following link: Thank you. This post was last edited by u010993957 at 22:12:42.
Local test URL
Content 1 connection address http: // 127.0.0.1/ask /? Ct = question & askaid = 1
Content 2 connection address http: // 127.0.0.1/ask /? Ct = question & askaid = 2
Content 3 connection address http: // 127.0.0.1/ask /? Ct = question & askaid = 3
Content 4 connection address http: // 127.0.0.1/ask /? Ct = question & askaid = 4
Content 5 connection address http: // 127.0.0.1/ask /? Ct = question & askaid = 5
This is true after pseudo-static
Http: // 127.0.0.1/ask/1.html
Http: // 127.0.0.1/ask/2.html
Http: // 127.0.0.1/ask/3.html
Http: // 127.0.0.1/ask/4.html
Http: // 127.0.0.1/ask/5.html
How to write NGINX pseudo-static rules? thank you!
Reply to discussion (solution)
Nginx only supports address rewriting and access
Http: // 127.0.0.1/ask/1.html
Rewrite
Http: // 127.0.0.1/ask /? Ct = question & askaid = 1
To execute the php script
If (! -F $ request_filename ){
Rewrite ^ ([^ \.] *)/(\ d +) \. html $1 /? Ct = question & askaid = $2 last;
}
Nginx only supports address rewriting and access
Http: // 127.0.0.1/ask/1.html
Rewrite
Http: // 127.0.0.1/ask /? Ct = question & askaid = 1
To execute the php script
If (! -F $ request_filename ){
Rewrite ^ ([^ \.] *)/(\ d +) \. html $1 /? Ct = question & askaid = $2 last;
}
RewriteEngine On
RewriteRule into index.html $ index. php
RewriteRule syntax (%0-9%%%%%.html $? Ct = question & askaid = $1
RewriteRule ^ ([0-9] +) $? Ct = browser & tid = $1
RewriteRule ^ t ([0-9] +) $? Ct = browser & tid2 = $1
Can the APACHE pseudo-static rules help me convert NGINX? thank you very much.
Rewrite ^/index.html $/index. php last;
If (! -F $ request_filename ){
Rewrite ^/(%0-9%%%%.html $ /? Ct = question & askaid = $1 last;
Rewrite ^/([0-9] +) $ /? Ct = browser & tid = $1 last;
Rewrite ^/t ([0-9] +) $ /? Ct = browser & tid2 = $1 last;
}
Rewrite ^/index.html $/index. php last;
If (! -F $ request_filename ){
Rewrite ^/(%0-9%%%%.html $ /? Ct = question & askaid = $1 last;
Rewrite ^/([0-9] +) $ /? Ct = browser & tid = $1 last;
Rewrite ^/t ([0-9] +) $ /? Ct = browser & tid2 = $1 last;
}
Add the NGINX configuration file
"Include/home/lum_safe_files/htaccess_files/. htaccess_ask ;"
"Rewrite ^/index.html $/index. php last;" is written in. htaccess_ask ;"
I use pseudo-static http: // 127.0.0.1/ask/index. php to make it http: // 127.0.0.1/ask/index.html
NGINX is also restarted. it seems that it still doesn't work. I don't know what's going on.
Rewrite ^/index.html $/index. php last;
If (! -F $ request_filename ){
Rewrite ^/(%0-9%%%%.html $ /? Ct = question & askaid = $1 last;
Rewrite ^/([0-9] +) $ /? Ct = browser & tid = $1 last;
Rewrite ^/t ([0-9] +) $ /? Ct = browser & tid2 = $1 last;
}
My directory is a level-2 Directory.
Ask Directory
Nginx uses the conf file instead of. htaccess.