How to redirect to any domain [duplicate]

How to redirect to any domain [duplicate] - 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 redirect to any domain [duplicate] error on your web browser. Problem :






Simple question
I own a domain and from that domain i want to redirect users who opens my old domain URL to my New Domain URL.


Solution :

There's only one way to redirect a client - and that's by issuing a HTTP 3xx response to their browser that contains a redirect URL.



In this case, you'll want to issue a 301 code HTTP response (Permanent redirect) that contains the URL for your new domain. Only a HTTP server can do this.



Some DNS services are able to do this at your request - they will put one of their own hosts into the DNS request and redirect the client to a new URL on your behalf.



Gateway servers or CDNs (such as Cloudflare) are also able to redirect clients with 3xx HTTP responses that you can configure from their dashboards.



Otherwise, you'll want to configure your own server to do so. Point the DNS to that server's IP and configure Apache/Nginx/IIS to respond with a 3xx redirect code. As an example, here is an article on Apache 3xx redirects.



If you have cpanel you can do it under domains > redirects



If you don't, add the following to your .htaccess file



Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %HTTP_HOST ^OLDDOMAIN.com$ [NC]
RewriteRule ^(.*)$ http://NEWDOMAIN.com [R=301,L]


You may need to tweak it for https if you have an SSL certificate


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

Comments

Popular posts from this blog

How do I redirect traffic only if being accessed from a specific port?

DNS entry to redirect constant url to changing directory name