Quantcast
Channel: Plesk 12.x for Linux
Viewing all articles
Browse latest Browse all 5091

URL re-writing using nginx?

$
0
0
I have recently started using nginx with PHP-FPM to serve PHP files, and this is blazing fast. However, where there are rewritten URLs, Apache becomes a bottleneck. How can I have nginx do the rewriting?

Let's say that I'm trying the following kind of rewrite in Apache:

Code:
RewriteRule /cat/([0-9]*) /index.php?cat=$1 [NC]
The equivalent code for nginx should be something like this:

Code:
location ~ /cat/(.*) {
    return 301 /index.php?cat=$1 last;
}
But I'm not sure...

URL re-writing using nginx?

Viewing all articles
Browse latest Browse all 5091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>