Install WP in subdomain when root document is changed
-
Hello everyone. Please help me with this situation:
I changed my main site Document Root from “public_html” to “public_html/site123/public” which is under the domain name: site123.org
If I want to install a WP site under y.site123.org, how can I do it?
I hope to install using the subdomain y.site123.org rather than site123.org/y.
Thanks in advance for your attention and help.
-
From a DNS (and webserver) perspective,
site123.organdy.site123.orgare two different domain names or vhosts.To have
y.site123.org, you need to create a separate vhost fory.site123.org. You may point its DocumentRoot to wherever you want!If you’re using cPanel (as the directory name
public_htmlhints at), you’ll need to create a SUB-DOMAINy.site123.org, but make sure to set the appropriate custom DocumentRoot. (Newer versions of cPanel can even create the subdomain’s document root outside of the public_html folder, eg/home/cPanel-Username/y.site123.com)Thanks very much.
Yes. I have changed the Document Root of the subdomain. And y.site123.org is now direct to the WP site. However, I cannot access the admin panel.
Both
y.site123.org/wp-admin/
and
site123.org/y/wp-admin/says, “The page isn’t redirecting properly”
yet, both
y.site123.org
and
site123.org/y/
work.Does this has something to do with the rewrite rules in the .htaccess conflict with each other?
Is there a way, I can change the location of the wordpress site? My host provider helps me to install a WP under the root document of the site123.org(say, public_html/123/public). And he told me that he cannot find a way to install WP in other root beside the above root. I wish it to be installed in public_html/y.
Can I change the document root of the WP, instead of have subdomain root redirected?
-
This reply was modified 3 years, 11 months ago by
ash3t.
I just reinstalled WP again. Thanks George.
Now, it take forever to show the theme pages. No matter I choose to preview or customize the theme, the right part is only blank page.
Please advise me what shall I do?
– shall I check .htaccess, just to make sure the reason that I cannot access admin page is not because of rewrite mods
– shall I ask the web host provider to install WP again? But I need to rule out the .htaccess issue first
– or shall I do something else?
Thanks.
Check your browser’s developer console while on the theme options page.
Are there any errors? Perhaps some resources cannot be loaded?
Also, does the website (front-end) fully load? Can you share the actual URL so I can take a look at the public website?
Thank you.
Since you didn’t mention there is any way to install WP other than root document of domain. I simply change the database back to the original one(not the new installed version).
In this site, both of these following site cannot be reached:
https://y.hrjh.org/wp-admin/
https://hrjh.org/y/wp-admin/And I have another question:
why the two databases are so different? One only contains 12 tables, and the other got 38 tables.
Sorry, to give you above information. Because I don’t know if I should ask my friend to install the WP again for me. I don’t want to bother him if it is unnecessary. And if there is something wrong with the previous site. Then a refresh installation is a must.
By the way, could it be the .htaccess file?
the .htaccess file only contains the details for the main site. But doesn’t include the default wordpress .htaccess details.
the following is the “mod_rewrite.c” section
—-<IfModule mod_rewrite.c> RewriteEngine on # Ensure the Authorization HTTP header is available to PHP RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Uncomment the following lines if you are not using a <code>public</code> directory # to prevent sensitive resources from being exposed. # RewriteRule /\.git / [F,L] # RewriteRule ^auth\.json$ / [F,L] # RewriteRule ^composer\.(lock|json)$ / [F,L] # RewriteRule ^config.php$ / [F,L] # RewriteRule ^flarum$ / [F,L] # RewriteRule ^storage/(.*)?$ / [F,L] # RewriteRule ^vendor/(.*)?$ / [F,L] # Pass requests that don't refer directly to files in the filesystem to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [QSA,L] </IfModule>—–
Can I simply add the following details at the end of the .htaccess file?
——————
# BEGIN WordPress RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress—————
Sorry, I just want to add this.
https://hrjh.org/y/wp-admin/install.php
This page is accessible but not these two:
-
This reply was modified 3 years, 11 months ago by
The topic ‘Install WP in subdomain when root document is changed’ is closed to new replies.