{"id":1419,"date":"2017-12-11T18:19:27","date_gmt":"2017-12-11T12:49:27","guid":{"rendered":"https:\/\/abhinavkr.com\/musings\/?p=1419"},"modified":"2017-12-11T18:23:21","modified_gmt":"2017-12-11T12:53:21","slug":"how-to-redirect-base-url-addresses-to-another-base-url","status":"publish","type":"post","link":"https:\/\/abhinavkr.com\/musings\/2017\/12\/how-to-redirect-base-url-addresses-to-another-base-url\/","title":{"rendered":"How to redirect base url addresses to another base URL"},"content":{"rendered":"<p>Say you have\u00a0<a href=\"http:\/\/abhinav.spsdarj.org\/2017\/12\/how-to-redirect-base-url-addresses-to-another-base-url\/\">http:\/\/abhinav.spsdarj.org\/2017\/12\/how-to-redirect-base-url-addresses-to-another-base-url\/<\/a> as a url on your old website (abhinav.spsdarj.org) and now you want the link to redirect to new website. Say\u00a0<a href=\"http:\/\/abhinav.ga\/2017\/12\/how-to-redirect-base-url-addresses-to-another-base-url\/\" target=\"_blank\" rel=\"noopener\">abhinav.ga<\/a>\u00a0but the url following abhinav.ga should stay the same and when typing the old url, should magically redirect with rest of the link intact to the new website.<\/p>\n<p>Here&#8217;s what you do. Go to the old site&#8217;s folder in your file manager, access the .htaccess and add this:<\/p>\n<pre>RewriteEngine on\r\n\r\nRewriteCond %{HTTP_HOST} ^abhinav\\.spsdarj\\.org$ [OR]\r\nRewriteCond %{HTTP_HOST} ^www\\.abhinav\\.spsdarj\\.org$\r\nRewriteRule ^(.*)$ \"http\\:\\\/\\\/blog\\.abhinav\\.ga\\\/$1\" [R=301,L]<\/pre>\n<p>This supports multiple redirects.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Say you have\u00a0http:\/\/abhinav.spsdarj.org\/2017\/12\/how-to-redirect-base-url-addresses-to-another-base-url\/ as a url on your old website (abhinav.spsdarj.org) and now you want the link to redirect to new website. Say\u00a0abhinav.ga\u00a0but the url following abhinav.ga should stay the same and when typing the old url, should magically redirect with rest of the link intact to the new website. Here&#8217;s what you do. Go&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[189],"tags":[241,242,240,170,239],"class_list":["post-1419","post","type-post","status-publish","format-standard","hentry","category-tech","tag-cms","tag-mediawiki","tag-pretty-url","tag-website","tag-wordpress"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4KGvB-mT","jetpack-related-posts":[{"id":624,"url":"https:\/\/abhinavkr.com\/musings\/2014\/10\/guide-to-setting-up-mediawiki-on-hostgator\/","url_meta":{"origin":1419,"position":0},"title":"Guide to setting up mediawiki on Hostgator","author":"Abhinav","date":"October 5, 2014","format":false,"excerpt":"It isn't all that easy to create a good mediawiki site with URL rewrite (you know... hide the \"index.php\" part and make it all pretty looking like \"YourDomain.ext\/wiki\/\"), So here I put down a step by step method of going through this cumbersome process. QuickInstall mediawiki in a directory in\u2026","rel":"","context":"In &quot;Tech&quot;","block_context":{"text":"Tech","link":"https:\/\/abhinavkr.com\/musings\/category\/knowledge\/tech\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":149,"url":"https:\/\/abhinavkr.com\/musings\/2013\/12\/image-of-the-day\/","url_meta":{"origin":1419,"position":1},"title":"image of the day","author":"Abhinav","date":"December 29, 2013","format":false,"excerpt":"Posted from WordPress for Android","rel":"","context":"In &quot;Pictures&quot;","block_context":{"text":"Pictures","link":"https:\/\/abhinavkr.com\/musings\/category\/pictures\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":693,"url":"https:\/\/abhinavkr.com\/musings\/2015\/02\/which-are-some-of-the-best-school-campuses-in-india\/","url_meta":{"origin":1419,"position":2},"title":"Which are some of the best school campuses in India?","author":"Abhinav","date":"February 13, 2015","format":false,"excerpt":"Read Abhinav Kumar's answer to Which are some of the best school campuses in India? on Quora","rel":"","context":"In &quot;Quora Post&quot;","block_context":{"text":"Quora Post","link":"https:\/\/abhinavkr.com\/musings\/category\/quora-post\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/abhinavkr.com\/musings\/wp-content\/uploads\/2014\/06\/333688_2648214407777_1328212241_32212794_430712197_o.jpg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/abhinavkr.com\/musings\/wp-content\/uploads\/2014\/06\/333688_2648214407777_1328212241_32212794_430712197_o.jpg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/abhinavkr.com\/musings\/wp-content\/uploads\/2014\/06\/333688_2648214407777_1328212241_32212794_430712197_o.jpg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/abhinavkr.com\/musings\/wp-content\/uploads\/2014\/06\/333688_2648214407777_1328212241_32212794_430712197_o.jpg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/abhinavkr.com\/musings\/wp-content\/uploads\/2014\/06\/333688_2648214407777_1328212241_32212794_430712197_o.jpg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":743,"url":"https:\/\/abhinavkr.com\/musings\/2015\/03\/vendetta\/","url_meta":{"origin":1419,"position":3},"title":"Vendetta","author":"Abhinav","date":"March 18, 2015","format":false,"excerpt":"Forget what you're told the world isn't all sunshine, the world isn't all rainbows, It's bitter, it's cold. Many an old eyes carry a thirst of a day of glory, of a day of victory. They burn with blood-lust. Look as you pass them. Their overflowing bank accounts, their countless\u2026","rel":"","context":"In &quot;Poems&quot;","block_context":{"text":"Poems","link":"https:\/\/abhinavkr.com\/musings\/category\/poems\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1254,"url":"https:\/\/abhinavkr.com\/musings\/2016\/12\/new-year-new-look-new-url-new-goodness\/","url_meta":{"origin":1419,"position":4},"title":"New year, New look, New URL, New goodness","author":"Abhinav","date":"December 29, 2016","format":false,"excerpt":"Woo Hoo! FInally I've migrated to an own domain for this site that has always been my side chick! :D So yeah. dumped the old subdomain freeloading off of spsdarj.org and moved to... err... another free domain. But this time, things are real. Top level domain better than sub-domain bullshit\u2026","rel":"","context":"In &quot;Life stuff&quot;","block_context":{"text":"Life stuff","link":"https:\/\/abhinavkr.com\/musings\/category\/life-stuff\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":217,"url":"https:\/\/abhinavkr.com\/musings\/2011\/12\/hey-ya\/","url_meta":{"origin":1419,"position":5},"title":"Hey Ya!","author":"Abhinav","date":"December 17, 2011","format":false,"excerpt":"The Site is all blank again. Sorry to say this but the various stuff I am still learning to do with my site got it all messed up and I had to Start it again from Scratch. Wont Happen Again.... Happy to See Me Back in Action... Stay tuned for\u2026","rel":"","context":"In &quot;Site Talk&quot;","block_context":{"text":"Site Talk","link":"https:\/\/abhinavkr.com\/musings\/category\/misc\/site-talk\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/abhinavkr.com\/musings\/wp-json\/wp\/v2\/posts\/1419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/abhinavkr.com\/musings\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/abhinavkr.com\/musings\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/abhinavkr.com\/musings\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/abhinavkr.com\/musings\/wp-json\/wp\/v2\/comments?post=1419"}],"version-history":[{"count":4,"href":"https:\/\/abhinavkr.com\/musings\/wp-json\/wp\/v2\/posts\/1419\/revisions"}],"predecessor-version":[{"id":1603,"href":"https:\/\/abhinavkr.com\/musings\/wp-json\/wp\/v2\/posts\/1419\/revisions\/1603"}],"wp:attachment":[{"href":"https:\/\/abhinavkr.com\/musings\/wp-json\/wp\/v2\/media?parent=1419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/abhinavkr.com\/musings\/wp-json\/wp\/v2\/categories?post=1419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/abhinavkr.com\/musings\/wp-json\/wp\/v2\/tags?post=1419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}