Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi everyone,
Server runs on Ubuntu 16.04.1 x64. Using WordPress. If more info needed, I’d be happy to provide.
I’m trying to redirect an old post to a new one but I’m having a lot of issues. I tried many codes and none worked so far.
Since the server uses Nginx , obviously I can’t use the usual 301 redirect codes that work with Apache.
I used this code a while back to redirect from http to https version for the whole site.
# BEGIN redirecting www to non www version
RewriteCond %{HTTP_HOST} =www.example.com
RewriteRule (.*) https://example.com/$1 [R=302,L]
# END redirecting www to non www version
It worked for that, so I tried modifying it and using it to also 301 an old post to a new one but it doesn’t work. There are no errors, but it just doesn’t work.
I also tried these codes (found by searching on Google) and almost all of them gave me a 500 Internal error for the whole site.
# BEGIN 301 Redirects
Redirect 301 /example.com/oldpost/
https://example.com/newpost/
# END 301 Redirects
# BEGIN 301 Redirects
rewrite ^/$ https://example.com/oldpost/ permanent;
rewrite ^/(.*)$ https://example.com/newpost/$1 permanent;
# END 301 Redirects
# BEGIN 301 Redirects
server {
listen 80;
server_name https://example.com/oldpost/;
return 301 $scheme:example.com/newpost/$request_uri;
}
# END 301 Redirects
# BEGIN 301 Redirects
server {
listen 80;
listen [::]:80;
hostname https://example.com/oldpost/
https://example.com/oldpost/;
return 301 https://example.com/newpost/$request_uri;
}
# END 301 Redirects
I know enough to research, find and copy-paste a piece fo code but beyond that I’m at a loss. I would appreciate any help.
Thanks very much in advance.
ebeecroft
68aa2215160846bca0a00f952c5fdc
009fd274aeae48f2bfbda6ef568676
Cloudstream Apk
032f50ee7f7d489db3b05e204fe139
032f50ee7f7d489db3b05e204fe139
Edward Sitarski
ebeecroft
dashan
34bcef38725b4e6eb5224ae028f17e