as previously i use apache for webservers, but now i want to migrate server to vps and i use nginx server. I have htaccess file here :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/(.*).pdf$ /generator/pdfviewer.php?kiwod=$1 [L]
</IfModule>
and i try to rewrite with this script:
location / { rewrite ^/(.*).pdf$ /generator/pdfviewer.php?kiwod=$1 break; }
but that script did not work . Please advise me for the correct script and where i put the code on nginx configuration?
please help me guys
Try to put rewrite outside of location, in server:
server {
listen 80;
server_name www.example.org example.org;
rewrite (.*) http://www.example.org$1;
}
...
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.