{"id":254,"date":"2012-07-14T06:31:13","date_gmt":"2012-07-14T06:31:13","guid":{"rendered":"http:\/\/pixert.com\/blog\/?p=254"},"modified":"2012-07-14T06:31:13","modified_gmt":"2012-07-14T06:31:13","slug":"redirect-old-domain-to-new-domain","status":"publish","type":"post","link":"https:\/\/pixert.com\/blog\/redirect-old-domain-to-new-domain\/","title":{"rendered":"Redirect Old Domain to New Domain"},"content":{"rendered":"<p>How to redirect old domain to new domain through .htaccess? You should add this code in .htaccess file<\/p>\n<p>Method no 1<\/p>\n<pre class=\"brush: plain; title: Code Block; notranslate\" title=\"Code Block\">\r\nOptions +FollowSymLinks\r\nRewriteEngine on\r\nRewriteRule (.*) http:\/\/www.newdomain.com\/$1 &#x5B;R=301,L]\r\n<\/pre>\n<p>Method no 2<\/p>\n<pre class=\"brush: plain; title: Code Block; notranslate\" title=\"Code Block\">\r\nRedirect 301 \/ http:\/\/www.newdomain.com\/\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to redirect old domain to new domain through .htaccess? You should add this code in .htaccess file Method no 1 Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http:\/\/www.newdomain.com\/$1 &#x5B;R=301,L] Method no 2 Redirect 301 \/ http:\/\/www.newdomain.com\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","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":""},"categories":[54,13,5],"tags":[113,49,111,112,6],"class_list":["post-254","post","type-post","status-publish","format-standard","hentry","category-code-snippet","category-cpanel","category-wordpress","tag-cms","tag-htaccess","tag-redirect","tag-seo","tag-wordpress-2"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1pvi1-46","jetpack-related-posts":[{"id":163,"url":"https:\/\/pixert.com\/blog\/moving-wordpress-blog-from-a-subdomain-to-a-subfolder\/","url_meta":{"origin":254,"position":0},"title":"Moving WordPress blog from a subdomain to a subfolder","author":"Pixel Insert \/ Pixert","date":"November 25, 2011","format":false,"excerpt":"I had this blog and this main site on same domain, pixert.com a year ago. I got high traffic to same domain. I separated the blog from main site after serious problems occurred. I made pixert.com\/blog for blog and pixert.com for main site That's a mistake I should \u00a0not done.\u2026","rel":"","context":"In &quot;cPanel&quot;","block_context":{"text":"cPanel","link":"https:\/\/pixert.com\/blog\/category\/cpanel\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":149,"url":"https:\/\/pixert.com\/blog\/redirect-https-to-http-on-your-site-with-htaccess\/","url_meta":{"origin":254,"position":1},"title":"Redirect https to http on your site with .htaccess","author":"Pixel Insert \/ Pixert","date":"October 19, 2011","format":false,"excerpt":"You can use the following snippet to avoid having duplicate listings in the search engines or when your site showing security errors on your browser [bash] Options +FollowSymlinks RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^(.*)$ http:\/\/www.yourdomain.com\/$1 [R=301,L] [\/bash]","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/cpanel-logo.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":195,"url":"https:\/\/pixert.com\/blog\/redirect-certain-pages-from-http-to-https-with-htaccess\/","url_meta":{"origin":254,"position":2},"title":"Redirect certain pages from http to https with .htaccess","author":"Pixel Insert \/ Pixert","date":"February 10, 2012","format":false,"excerpt":"The following trick is useful for E-Commerce sites. \u00a0We only need few pages redirected to https to secure transaction This will automatically rewrite the url to https as long as the page is not already an https link. This conditional keeps it from causing a loop. It's very handy to\u2026","rel":"","context":"In &quot;WordPress&quot;","block_context":{"text":"WordPress","link":"https:\/\/pixert.com\/blog\/category\/wordpress\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":253,"url":"https:\/\/pixert.com\/blog\/how-to-301-redirect-all-404-error-pages-to-homepage-in-wordpress\/","url_meta":{"origin":254,"position":3},"title":"How to 301 Redirect All 404 Error Pages to Homepage in WordPress","author":"Pixel Insert \/ Pixert","date":"October 6, 2012","format":false,"excerpt":"404 Not Found errors are generated when users follow broken\/dead links. \u00a0You\u2019d be amazed how many 404 errors even the best websites have. \u00a0The quickest fix is to redirect your 404 errors to your home page. Almost every theme that you use with your self hosted WordPress Blog have an\u2026","rel":"","context":"In &quot;WordPress&quot;","block_context":{"text":"WordPress","link":"https:\/\/pixert.com\/blog\/category\/wordpress\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":78,"url":"https:\/\/pixert.com\/blog\/limiting-access-to-admin-folder-htaccess\/","url_meta":{"origin":254,"position":4},"title":"Limiting Access to Admin folder via .htaccess","author":"Pixel Insert \/ Pixert","date":"March 31, 2011","format":false,"excerpt":"Some CMS have admin folder. It's an important folder because it has all the files that deal with administration. If the security of the files in it is compromised, bad things can happen. One effective option to reducing the risk of a security breach on the Admin folder is by\u2026","rel":"","context":"In &quot;Web Apps&quot;","block_context":{"text":"Web Apps","link":"https:\/\/pixert.com\/blog\/category\/web-apps\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock-288x300.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":86,"url":"https:\/\/pixert.com\/blog\/protect-htaccess-file\/","url_meta":{"origin":254,"position":5},"title":"Protect .htaccess file","author":"Pixel Insert \/ Pixert","date":"April 5, 2011","format":false,"excerpt":"When avisitor tries to obtain access to .htaccess file, server automatically generates a 403 forbidden error. However, we can apply an extra layer of security to .htaccess Add the following [text] # Protect the htaccess file <Files .htaccess> Order Allow,Deny Deny from all <\/Files> [\/text] Note: htaccess file permissions is\u2026","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock-150x150.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/comments?post=254"}],"version-history":[{"count":0,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/254\/revisions"}],"wp:attachment":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media?parent=254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/categories?post=254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/tags?post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}