How to map many old URLs to a new host with a redirect under Apache cPanel?

How to map many old URLs to a new host with a redirect under Apache cPanel? - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the How to map many old URLs to a new host with a redirect under Apache cPanel? error on your web browser. Problem :


I moved some of the content on my website to an external site. However, a lot of places on the Internet still link to the missing pages, resulting in 404 messages. What is the best method of redirecting people to the new and correct Web address in this instance? I don't want to make Google angry at me!



I am using a paid Web hosting provider. They use Apache 2.2.23 and I manage the site using cPanel. It's not really a wiki, but a maths website. Here are two example URLs:




  • https://www.example.org/m/db5zz5uh

  • https://www.example.org/m/mpvsttas



Here's an example of one of the missing pages on my site:




  • http://mywebsite.net/mathematics/several-words-separated-by-hyphens.php



(Note also, there are a few pages I haven't migrated to the other site yet, and still use the old naming scheme.)



I don't see a pattern I can take advantage of. Will probably need to map each URL individually.


Solution :

If you need to change the URL of a page as it is shown in search engine results, use a server-side 301 redirect. This is the best way to ensure that users and search engines are directed to the correct page. The 301 status code means that a page has permanently moved to a new location.



301 redirects are particularly useful in the following circumstances:



You've moved your site to a new domain, and you want to make the transition as seamless as possible.
People access your site through several different URLs. If, for example, your home page can be reached in multiple ways - for instance, http://example.com/home, http://home.example.com, or http://www.example.com - it's a good idea to pick one of those URLs as your preferred (canonical) destination, and use 301 redirects to send traffic from the other URLs to your preferred URL.
You're merging two websites and want to make sure that links to outdated URLs are redirected to the correct pages.
To implement a 301 redirect for websites that are hosted on servers running Apache, you'll need access to your server's .htaccess file. (If you're not sure about your access or your server software, check with your webhoster.) For more information, consult the Apache .htaccess Tutorial and the Apache URL Rewriting Guide. If your site is hosted on a server running other software, check with your hoster for more details.


We hope that this article has helped you resolve the redirects, apache, 404 error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=