{"id":943,"date":"2020-06-08T05:32:15","date_gmt":"2020-06-08T05:32:15","guid":{"rendered":"http:\/\/ubiq.co\/tech-blog\/?p=943"},"modified":"2026-03-11T05:45:48","modified_gmt":"2026-03-11T05:45:48","slug":"how-to-redirect-all-pages-to-new-domain","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/","title":{"rendered":"How To Redirect All Pages To New Domain in Apache"},"content":{"rendered":"<p>When you migrate website to another domain, you will need to redirect old domain to new domain. You will also need to redirect all URLs, pages to another domain. Here&#8217;s how to redirect all pages to new domain in Apache. You can use these steps to redirect old website to new website.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#How_To_Redirect_All_Pages_To_New_Domain_in_Apache\" >How To Redirect All Pages To New Domain in Apache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#Using_Apache_Server_Configuration\" >Using Apache Server Configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#1_Open_Apache_Server_Configuration_File\" >1. Open Apache Server Configuration File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#2_Redirect_All_Pages_to_Another_Domain_in_Apache\" >2. Redirect All Pages to Another Domain in Apache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#3_Restart_Apache_Server\" >3. Restart Apache Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#Using_htaccessmod_rewrite\" >Using .htaccess\/mod_rewrite<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#1_Open_htaccess_file\" >1. Open .htaccess file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#2_Redirect_All_Pages_to_New_Domain_in_Apache\" >2. Redirect All Pages to New Domain in Apache<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#Using_Redirect\" >Using Redirect<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#Using_RewriteRule\" >Using RewriteRule<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#3_Restart_Apache_Server-2\" >3. Restart Apache Server<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_To_Redirect_All_Pages_To_New_Domain_in_Apache\"><\/span>How To Redirect All Pages To New Domain in Apache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Here are the steps to redirect all pages to new domain in Apache. There are 2 ways to redirect all URLs to another domain in Apache &#8211; using server configuration and using .htaccess file. We will look at both these approaches separately.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Using_Apache_Server_Configuration\"><\/span>Using Apache Server Configuration<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In this case, we redirect all old domain to new domain by modifying Apache server configuration file.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"1_Open_Apache_Server_Configuration_File\"><\/span>1. Open Apache Server Configuration File<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Apache server configuration is located at one of the following locations, depending on your installation setup and Linux version.<\/p>\n<ul>\n<li>\/etc\/apache2\/httpd. conf<\/li>\n<li>\/etc\/apache2\/apache2. conf<\/li>\n<li>\/etc\/httpd\/httpd. conf<\/li>\n<li>\/etc\/httpd\/conf\/httpd. conf<\/li>\n<\/ul>\n<p>Open Terminal and run the following command to open Apache Server configuration file.<\/p>\n<pre>$ sudo vi \/etc\/apache2\/httpd. conf\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"2_Redirect_All_Pages_to_Another_Domain_in_Apache\"><\/span>2. Redirect All Pages to Another Domain in Apache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Let&#8217;s say you want to <a href=\"https:\/\/ubiq.co\/tech-blog\/redirect-subfolder-using-htaccess\/\">redirect<\/a> all pages of your website (e.g www.website.com) to another domain (e.g www.new-site.com), then add the following <em>VirtualHost<\/em> tags to your server configuration file.<\/p>\n<pre>&lt;VirtualHost *:80&gt;\nServerName www.website.com\n<strong>Redirect 301 \/ http:\/\/www.new-site.com\/<\/strong>\n&lt;\/VirtualHost&gt;\n\n&lt;VirtualHost *:80&gt;\nServerName www.new-site.com\n. . .\n&lt;\/VirtualHost&gt;\n<\/pre>\n<p>In the above code, we create 2 Virtual Hosts, one for old domain and new domain. We configure virtual host for website.com to redirect all requests to new-site.com (in <strong>bold<\/strong>)<\/p>\n<p>Bonus Read : <a href=\"http:\/\/ubiq.co\/tech-blog\/top-10-ssl-certificate-providers-website\/\">Top 10 SSL Certificate Providers for Website<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Restart_Apache_Server\"><\/span>3. Restart Apache Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Restart Apache Server to apply changes.<\/p>\n<p>Ubuntu\/Debian:<\/p>\n<pre>$ sudo service apache2 start<\/pre>\n<p>CentOS\/Fedora\/Redhat:<\/p>\n<pre>$ service httpd restart<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Using_htaccessmod_rewrite\"><\/span>Using .htaccess\/mod_rewrite<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you don&#8217;t have access to Apache server configuration, or don&#8217;t want to change Apache server configuration, then you can use .htaccess file to redirect all pages of your domain to another domain.<\/p>\n<p>Before you proceed, please ensure you have enabled <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/mod\/mod_rewrite.html\" target=\"_blank\" rel=\"noopener\">mod_rewrite<\/a> in your Apache server. Here are the steps to do it and setup .htaccess file for your website.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"1_Open_htaccess_file\"><\/span>1. Open .htaccess file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Open .htaccess file for your website (e.g website.com) in a text editor, <strong>NOT<\/strong> the .htaccess for new-site.com<\/p>\n<pre>$ sudo vi \/var\/www\/website.com\/.htaccess\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"2_Redirect_All_Pages_to_New_Domain_in_Apache\"><\/span>2. Redirect All Pages to New Domain in Apache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Add the following lines to redirect your website (e.g website.com) to another website (e.g new-site.com). There are multiple ways to redirect domain to another domain using .htaccess. You can use any of them, they all give the same result.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Using_Redirect\"><\/span>Using Redirect<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre>RewriteEngine on\nRedirect 301 \/ http:\/\/website.com\/\n<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Using_RewriteRule\"><\/span>Using RewriteRule<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre>RewriteEngine on\nRewriteCond \"%{HTTP_HOST}\"   \"!^www\\.website\\.com\" [NC]\nRewriteCond \"%{HTTP_HOST}\"   \"!^$\"\nRewriteRule \"^\/?(.*)\"        \"http:\/\/www.new-site.com\/$1\" [L,R,NE]\n<\/pre>\n<p>Bonus Read : <a href=\"http:\/\/ubiq.co\/tech-blog\/redirect-page-another-domain-htaccess-file\/\">How to Redirect Page to Another Domain using .htaccess<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Restart_Apache_Server-2\"><\/span>3. Restart Apache Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Restart Apache Server to apply changes.<\/p>\n<p>Ubuntu\/Debian:<\/p>\n<pre>$ sudo service apache2 start<\/pre>\n<p>CentOS\/Fedora\/Redhat:<\/p>\n<pre>$ service httpd restart<\/pre>\n<p>That&#8217;s it! Now Apache will automatically redirect all requests from www.website.com to www.new-site.com.<\/p>\n<p><a href=\"http:\/\/ubiq.co\/\">Ubiq<\/a>\u00a0makes it easy to visualize data in minutes, and monitor in real-time dashboards.\u00a0<a href=\"http:\/\/ubiq.co\/accounts\/register\">Try it<\/a>\u00a0Today!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you migrate website, you need to redirect all URLs to another domain. Here&#8217;s how to redirect all pages to new domain in  Apache.<\/p>\n","protected":false},"author":1,"featured_media":954,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[5,30],"class_list":["post-943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","tag-redirect","tag-website-migration"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Redirect All Pages To New Domain in Apache - Ubiq BI<\/title>\n<meta name=\"description\" content=\"When you migrate website, you need to redirect all URLs to another domain. Here&#039;s how to redirect all pages to new domain in Apache.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Redirect All Pages To New Domain in Apache - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"When you migrate website, you need to redirect all URLs to another domain. Here&#039;s how to redirect all pages to new domain in Apache.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-08T05:32:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-11T05:45:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/06\/redirect-old-domain-to-new-website.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"990\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How To Redirect All Pages To New Domain in Apache\",\"datePublished\":\"2020-06-08T05:32:15+00:00\",\"dateModified\":\"2026-03-11T05:45:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/\"},\"wordCount\":486,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/redirect-old-domain-to-new-website.png?fit=1920%2C990&ssl=1\",\"keywords\":[\"redirect\",\"website migration\"],\"articleSection\":[\"Apache\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/\",\"name\":\"How To Redirect All Pages To New Domain in Apache - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/redirect-old-domain-to-new-website.png?fit=1920%2C990&ssl=1\",\"datePublished\":\"2020-06-08T05:32:15+00:00\",\"dateModified\":\"2026-03-11T05:45:48+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"When you migrate website, you need to redirect all URLs to another domain. Here's how to redirect all pages to new domain in Apache.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/redirect-old-domain-to-new-website.png?fit=1920%2C990&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/redirect-old-domain-to-new-website.png?fit=1920%2C990&ssl=1\",\"width\":1920,\"height\":990,\"caption\":\"redirect old domain to new website\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-all-pages-to-new-domain\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Redirect All Pages To New Domain in Apache\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Redirect All Pages To New Domain in Apache - Ubiq BI","description":"When you migrate website, you need to redirect all URLs to another domain. Here's how to redirect all pages to new domain in Apache.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/","og_locale":"en_US","og_type":"article","og_title":"How To Redirect All Pages To New Domain in Apache - Ubiq BI","og_description":"When you migrate website, you need to redirect all URLs to another domain. Here's how to redirect all pages to new domain in Apache.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-06-08T05:32:15+00:00","article_modified_time":"2026-03-11T05:45:48+00:00","og_image":[{"width":1920,"height":990,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/06\/redirect-old-domain-to-new-website.png","type":"image\/png"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How To Redirect All Pages To New Domain in Apache","datePublished":"2020-06-08T05:32:15+00:00","dateModified":"2026-03-11T05:45:48+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/"},"wordCount":486,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/06\/redirect-old-domain-to-new-website.png?fit=1920%2C990&ssl=1","keywords":["redirect","website migration"],"articleSection":["Apache"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/","name":"How To Redirect All Pages To New Domain in Apache - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/06\/redirect-old-domain-to-new-website.png?fit=1920%2C990&ssl=1","datePublished":"2020-06-08T05:32:15+00:00","dateModified":"2026-03-11T05:45:48+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"When you migrate website, you need to redirect all URLs to another domain. Here's how to redirect all pages to new domain in Apache.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/06\/redirect-old-domain-to-new-website.png?fit=1920%2C990&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/06\/redirect-old-domain-to-new-website.png?fit=1920%2C990&ssl=1","width":1920,"height":990,"caption":"redirect old domain to new website"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-all-pages-to-new-domain\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How To Redirect All Pages To New Domain in Apache"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/06\/redirect-old-domain-to-new-website.png?fit=1920%2C990&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-fd","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=943"}],"version-history":[{"count":16,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/943\/revisions"}],"predecessor-version":[{"id":10684,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/943\/revisions\/10684"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/954"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}