Redirect URL in Nginx - wordpress

I recently migrated my website to Digital Ocean through the help of a Server Guy. I had good knowledge about .htacess apache rules but Nginx is realy difficult for me.
I had some files on my Wordpress site which have been deleted now. I want to permanently redirect those URLs to the homepage of my site.
Issue with the site: https://jobify.in
Status: Resolved
I have tried to add several codes in Nginx.conf and restarted the server but the redirection isn't taking place.
May be, I'm adding wrong codes. Kindly, help me to redirect these pages :)

For permanent redirects use return and use if conditions for conditional redirects
See here

Related

Using 301 redirects at server config level on NGINX to avoid suspected WP issues?

OK, our old website is Wordpress installed on a NGINX bitnami distribution in AWS.
Our new website is on managed hosting on a new domain name.
For the migration, we'd used the plugin 'Simple 301 redirects' to map each page to the new site structure.
However, for reasons we can't fathom and have only just spotted, all the redirects are reporting as 302 - which is hurting our SEO.
Our theory is that re-implementing the 301s but at server level config on the NGINX server will be used before it hits the WP installation, and hopefully achieve an actual 301 redirect.
I can find a number of support articles that might help us: https://www.digitalocean.com/community/tutorials/how-to-create-temporary-and-permanent-redirects-with-nginx although this article suggests using return instead of rewrite: https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/?highlight=rewrite#taxing-rewrites
If our theory is correct, we'll create a new server config that redirects each individual page (we need to do this, as the site structure has changed in some cases - it is about 250 pages FYI).
Would somebody be able to offer any additional advice on this?
We're still baffled as to why it is returning 302 redirects rather than 301...!
Greatly appreciated!

Redirect structure in Nginx for expired domain names

I'm having a little trouble! Want to get help. Recently, I bought an expired domain name https://www.ar-hp.com after I installed the website on this domain. I realized that there are many 404 errors in webmastertool. Now I want to redirect the old links with the structure https: //www.ar-hp.com/vb / ...... to the homepage is https://www.ar-hp.com I'm using Use vps Centos and Nginx. Now I have to use any code to do that. Thank you very much.

HTTPS to HTTP redirect via .htaccess

I have a website hosted on a GoDaddy wordpress hosting. We had an SSL, but not longer have the SSL. Google archive some pages with the SSL so I just want to redirect https requests to the http version of the sit.e I have access to the .htaccess file so I figured that was the best way to do it.
I have been searching around and tried tons of different .htaccess redirects, but none of them are working. Including this https to http 301 redirect via htaccess. I know the htaccess is functioning because wordpress is working and I added a few test redirects to it and they worked as well.
Any thoughts or suggestions would be much appreciated.
Thanks.
Wordpress has its own redirect procedure.
Check in the General Settings of you WP Panel for the WordPress Address and the Site Address fields. Make sure they both are non ssl absolute paths.
Another thing to check is on the wp-config.php
define('FORCE_SSL_ADMIN', true);
That could have been added by another plugin. Remove it or make it false.
One last thing you could try (not the best option) is to ask google to remove those specific links, here's a reference for that.
I hope this helps.

How can I do a 301 Redirect from HTTPS to HTTPS via .htaccess

I've done a bunch of research and have tried a lot of code to accomplish the following task and I am not having any luck. I am trying to forward the following:
from: https://www.oldwebsite.com
to: https://www.newwebsite.com
The reason behind the domain change was rebranding and SEO purposes. We do not have the old hosting available anymore, but I have added oldwebsite.com as an alias to the newwebsite.com. We are using GoDaddy's Wordpress hosting/installation.
Please note, the non-SSL (http://) forwards to the newsite.com with no issues; when someone clicks on an existing link with https://oldsite.com that is when the link breakage occurs. GoDaddy has recommended added the old domain as an alias (completed) and modifying the .htaccess file to perform the redirect, but it doesn't work.
Anyone have experience solving this issue?

How to do a htaccess modrewrite for redirecting a url?

Got an urgent issue, and I'm totally stumped.
We recently migrated a bunch of networked blogs, and realized one of them was using a subfolder structure, whereas all the new system is all subdomains. The wordpress multisite system doesn't allow for both subdomains and subfolder structures, so I'm guessing the logical solution would be to use htaccess to redirect requests for the old urls to the new url. But how do I write the code in the htaccess?
I need to make all requests to http://www.mysite.com/720/etcetc
to http://blog.mysite.com/etcetc
Is this possible or is there another more viable solution?
Your assistance would be greatly greatly appreciated.
Thanks in advance.
My recommendation would be to install the Redirection plug-in on whatever site you have running at http://www.mysite.com/ and have it dynamically redirect all requests to /720/etcetc/* to the new address. Redirection can add the appropriate HTTP 301 headers and, since it's doing things dynamically, you won't need to hunt down each and every URL to write your .htaccess file.

Resources