{"id":350,"date":"2013-01-01T13:01:57","date_gmt":"2013-01-01T13:01:57","guid":{"rendered":"https:\/\/puvox.software\/?p=350"},"modified":"2024-02-15T08:28:05","modified_gmt":"2024-02-15T08:28:05","slug":"setup-wordpress-subdomains-for-multi-site-manually","status":"publish","type":"post","link":"https:\/\/puvox.software\/blog\/setup-wordpress-subdomains-for-multi-site-manually\/","title":{"rendered":"Setup WordPress Subdomains (for Multi-Site) manually [-]"},"content":{"rendered":"<div class=\"default-content-clss content_350 type_post \"><div class=\"wpLinkHere\">Remember short-link to MUST-HAVE WP plugins: <a href=\"https:\/\/puvox.software\/wordpress\">puvox.software\/wordpress<\/a>&nbsp; <\/div><div style=\"clear:both;\"><\/div><p><em>(p.s. UPDATE : this method doesnt work correctly at this moment)<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>When your hosting doesnt support WildCard subdomains, you can use this method:<\/p>\n<p>&nbsp;<\/p>\n<p>Manually create this file <code>\/subdomain\/index.php<\/code> with this content:<\/p>\n<p><code>&lt;?php require_once( __dir__ . '\/..\/index.php' ); ?&gt;<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>and <code>\/subdomain\/wp-admin\/index.php<\/code> with this content:<\/p>\n<p><code>&lt;?php require_once( __dir__ . '\/..\/wp-admin\/index.php' ); ?&gt;<\/code><\/p>\n<p>and <code>\/subdomain\/.htaccess<\/code> with this content (just change <code>example.com<\/code> ):<\/p>\n<pre>&lt;IfModule mod_rewrite.c&gt;\r\n RewriteEngine On\r\n RewriteCond %{REQUEST_FILENAME} !-d\r\n RewriteCond %{REQUEST_FILENAME} !-f\r\n RewriteRule ^(.*?)$ http:\/\/<code>example<\/code>.com\/$1 [L,R] RewriteBase \/ RewriteRule ^index\\.php$ - [L] # add a trailing slash to \/wp-admin RewriteRule ^wp-admin$ wp-admin\/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^(wp-(content|admin|includes).*) $1 [L] RewriteRule ^(.*\\.php)$ $1 [L] RewriteRule . index.php [L] &lt;\/IfModule&gt;<\/pre>\n<p>Note, that the only drawback of this code, is that it redirects all urls (not found files at subdomain) to root domain url, instead of rewriting.. I mean, if you visit <code>subdomain.example.com\/myfile.jpg<\/code> it redirects to\u00a0<code>example.com\/myfile.jpg<\/code>.<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<div class=\"default-content-clss excerpt_350 type_post \"><p>Remember short-link to MUST-HAVE WP plugins: puvox.software\/wordpress&nbsp; (p.s. UPDATE : this method doesnt work correctly at this moment) &nbsp; When your hosting doesnt support WildCard subdomains, you can use this<a class=\"excerpt-read-more\" href=\"https:\/\/puvox.software\/blog\/setup-wordpress-subdomains-for-multi-site-manually\/\">(Continue Reading)<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":5544,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[],"class_list":["post-350","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/comments?post=350"}],"version-history":[{"count":1,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/350\/revisions"}],"predecessor-version":[{"id":5545,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/350\/revisions\/5545"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/media\/5544"}],"wp:attachment":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/media?parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/categories?post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/tags?post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}