I am moving my blog from b.com to b.com . Now I want to tell Google / bookmarks that all blogposts (about 100) have been transferred to b.com . I just want to redirect blogposts and nothing more.
After reading the map module in nginx, I tried the following:
map_hash_bucket_size 128; map $uri $new { /post http://b.com/post
And when I put the following line inside the server block:
rewrite ^ $new redirect;
It will redirect all 100 messages, but all other pages in my domain will be erroneous: 302 Found .
Here is my entire server block inside config:
server { listen 80; server_name b.com; root /my/old/path/; index index.html; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; }
I think the map is interfering with calling try_files for location \ (which I need).
source share