{"id":25,"date":"2017-10-08T05:00:00","date_gmt":"2017-10-08T05:00:00","guid":{"rendered":"https:\/\/linuxadmin.melberi.com\/uncategorized\/apache-url-redirect-how-to"},"modified":"2017-10-08T15:04:46","modified_gmt":"2017-10-08T15:04:46","slug":"apache-url-redirect","status":"publish","type":"post","link":"https:\/\/www.melberi.com\/linuxadmin\/apache\/apache-url-redirect","title":{"rendered":"Apache Website or URL Redirection using httpd.cong"},"content":{"rendered":"<p>How to redirect a Website or Domain to another URL or External website or HTTPS in Apache web server httpd.cong<\/p>\n<h2><span style=\"text-decoration: underline;\">Apache Website Redirection<\/span><\/h2>\n<p>URL redirection, also called URL forwarding and domain redirection also called domain forwarding<\/p>\n<p>To redirect oldserver.com to newserver.com,<br \/>\nadd the following line in your Apache httpd.conf file<\/p>\n<p><b>RedirectPermanent \/ &#8220;http:\/\/www.newserver.com\/&#8221;<\/b><\/p>\n<p><strong>Sample httpd.cong<\/strong><\/p>\n<p><span style=\"color: #808080;\">&lt; VirtualHost 192.168.1.1:* &gt;<\/span><\/p>\n<p><span style=\"color: #808080;\">DocumentRoot \/var\/www\/html\/web\/<\/span><br \/>\n<span style=\"color: #808080;\"> ServerName oldserver.com<\/span><br \/>\n<span style=\"color: #808080;\"> RewriteEngine On<\/span><br \/>\n<span style=\"color: #808080;\"> RewriteCond %{REQUEST_METHOD} ^TRACE<\/span><br \/>\n<span style=\"color: #808080;\"> RewriteRule .* &#8211; [F]<\/span><br \/>\n<span style=\"color: #808080;\"> &lt; Directory &#8220;\/var\/www\/html\/web&#8221; &gt;<\/span><br \/>\n<span style=\"color: #808080;\"> allow from all<\/span><br \/>\n<span style=\"color: #808080;\"> Options -Indexes<\/span><br \/>\n<span style=\"color: #808080;\"> DirectoryIndex index.html<\/span><br \/>\n<span style=\"color: #808080;\"> <b>RedirectPermanent \/ &#8220;http:\/\/www.newserver.com\/&#8221;<\/b><\/span><br \/>\n<span style=\"color: #808080;\"> &lt; \/Directory &gt;<\/span><br \/>\n<span style=\"color: #808080;\"> &lt; \/VirtualHost &gt;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to redirect a Website or Domain to another URL or External website or HTTPS in Apache web server httpd.cong Apache Website Redirection URL redirection, also called URL forwarding and&#8230; <a href=\"https:\/\/www.melberi.com\/linuxadmin\/apache\/apache-url-redirect\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/25"}],"collection":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/comments?post=25"}],"version-history":[{"count":3,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":473,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/25\/revisions\/473"}],"wp:attachment":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/media?parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/categories?post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/tags?post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}