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

Re: Redirect 301 only exact url and not all other sub urls [SOLVED]

$
0
0
Hi Jim,
Thank you very much!

In LOCATION statement I forgot the equal operator "="

location = /catalog/category1 {
return 301 /catalog/newcategory1;
}

In this way redirect only the exact match with (https://www.mydomain.com/catalog/category1 ) and the other sub urls remains the same.

Before
https://www.mydomain.com/catalog/category1
https://www.mydomain.com/catalog/category1/product1
https://www.mydomain.com/catalog/category1/product2
https://www.mydomain.com/catalog/category1/product3

After
https://www.mydomain.com/catalog/newcategory1
https://www.mydomain.com/catalog/category1/product1
https://www.mydomain.com/catalog/category1/product2
https://www.mydomain.com/catalog/category1/product3

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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