Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

yet another redirect... from one path to another /path1/ -> /path2

$
0
0
Question 1:
Now i want to make old links https://domain.tld/performers/ into https://domain.tld/models/ how do I do that? have tried quite a few things I've been able to locate by searches, but not one do it right for me

Here is my rewrite (optimisation suggestions ok :) )

location /models {
rewrite ^/(performers|models)/$ /index.php?controller=models;
rewrite ^/(performers|models)/(alphabetical|rating)/$ /index.php?controller=models&sortby=$2;
rewrite ^/(performers|models)/page([0-9]+).html$ /index.php?controller=models&page=$2;
rewrite ^/(performers|models)/(alphabetical|rating)/page([0-9]+).html$ /index.php?controller=models&sortby=$2&page=$3;
rewrite ^/(performers|models)/(.*)/page([0-9]+).html$ /index.php?controller=models&letter=$2&page=$3;
rewrite ^/(performers|models)/(.*)/(alphabetical|rating)/$ /index.php?controller=models&letter=$2&sortby=$3&page=1;
rewrite ^/(performers|models)/(.*)/(alphabetical|rating)/page([0-9]+).html$ /index.php?controller=models&letter=$2&sortby=$3&page=$4;
rewrite ^/(performers|models)/(.*)-([0-9]+).html$ /index.php?controller=model_bio&id=$3 last;
rewrite ^/(performers|models)/(.*)/$ /index.php?controller=models&letter=$2&page=1;
}



Question 2

if I should redirect from https://domain.tld/media/ to https://media.domain.tld/ and by that skip the /media in the url, I can't use the return 301 https://$server_name$request_uri; as that would add the /media to the url and then fails..

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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