{"id":826,"date":"2014-10-22T02:01:43","date_gmt":"2014-10-22T02:01:43","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=826"},"modified":"2014-10-22T02:01:43","modified_gmt":"2014-10-22T02:01:43","slug":"subdomains-redirecting-primary-domain","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/10\/22\/subdomains-redirecting-primary-domain\/","title":{"rendered":"Subdomains redirecting to primary domain"},"content":{"rendered":"<p><strong>Scenario<\/strong><\/p>\n<p>WordPress is installed for the primary domain. WordPress is installed for a subdomain. Subdomains set up under\u00a0the primary domain.<\/p>\n<p>Primary domain &#8211; domain.com<br \/>\nSubdomain &#8211; demo.domain.com<\/p>\n<p>Issue: demo.domain.com redirects to domain.com\/demo or domin.com<\/p>\n<p>Check if there is an .htaccess file in the subdomain directory:<\/p>\n<p>If not, create an .htaccess file and include the following:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># nano \/home\/domain\/public_html\/demo\/.htaccess<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># BEGIN WordPress\nRewriteEngine On\nRewriteBase \/demo\/\nRewriteRule ^index.php$ - &#x5B;L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . \/demo\/index.php &#x5B;L]\n# END WordPress\n<\/pre>\n<p>If needed&#8230;Force www. version of domain to be used<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nRewriteEngine on\nRewriteCond %{HTTP_HOST} ^domain.com &#x5B;NC]\nRewriteRule ^(.*)$ http:\/\/www.domain.com\/$1 &#x5B;L,R=301,NC]\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Scenario WordPress is installed for the primary domain. WordPress is installed for a subdomain. Subdomains set up under\u00a0the primary domain. Primary domain &#8211; domain.com Subdomain &#8211; demo.domain.com Issue: demo.domain.com redirects to domain.com\/demo or domin.com Check if there is an .htaccess file in the subdomain directory: If not, create an .htaccess file and include the following: &#8230; <a title=\"Subdomains redirecting to primary domain\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/10\/22\/subdomains-redirecting-primary-domain\/\" aria-label=\"Read more about Subdomains redirecting to primary domain\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-826","post","type-post","status-publish","format-standard","hentry","category-cpanel"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=826"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/826\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}