fix(tazjin/blog): Make redirects from old links permanent
Change-Id: I41d71f9aae7e64bdfef8f2b7142d13009b216eaa Reviewed-on: https://cl.tvl.fyi/c/depot/+/2752 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
This commit is contained in:
		
							parent
							
								
									ab7e752b4a
								
							
						
					
					
						commit
						d2376e24d1
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -52,8 +52,7 @@ in {
 | 
			
		|||
  # Generate embeddable nginx configuration for redirects from old post URLs
 | 
			
		||||
  oldRedirects = lib.concatStringsSep "\n" (map (post: ''
 | 
			
		||||
    location ~* ^(/en)?/${post.oldKey} {
 | 
			
		||||
      # TODO(tazjin): 301 once this works
 | 
			
		||||
      return 302 https://tazj.in/blog/${post.key};
 | 
			
		||||
      return 301 https://tazj.in/blog/${post.key};
 | 
			
		||||
    }
 | 
			
		||||
  '') (filter (hasAttr "oldKey") posts));
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue