last day (15 days later) » 

7:02 AM
0
A: Wordpress site in subdirectory load site in main directory

SidThere are some things you can try: Check the wp-options table in your staging site database and look for site URL in 2 places. Change it to the correct staging address if already not. Refresh the permalinks of the staging site. I am guessing this should fix your problem. If not, please share ...

 
I already change site URL and home with correct url in wp-options and how to refresh permalinks if I cannot open and login to wordpress dashboard ?
And for the main and staging yes it's have same content. How to add robots.txt file in staging ?
 
Sid
ok. lets worry about the robots file later. Check your wp-config.php file for correct DB details. What is the result of example.com/staging/wp-login.php? Is it redirecting to the main domain?
 
Yes in wp-config.php the DB details is correct. And, example.com/staging/wp-login.php yes it gives me redirecting to the main domain page not found.
 
Sid
ok try this one, open the index.php for your staging site (the one inside WordPress not in theme folder), find the line require( dirname( FILE ) . '/wp-blog-header.php' ); and change it to require( dirname( FILE ) . '/staging/wp-blog-header.php' ); Let me know the results.
If this doesn't work, try moving your staging instance from a subdirectory to subdomain. something like staging.example.com. This is a lot easy to setup.
 
I change like this require( dirname( __FILE__ ) . '/staging/wp-blog-header.php' ); but still gives redirect to main site page not found
I tried to use subdomain but it's give me domain not register
 
Sid
7:02 AM
Would it be fine if we moved the instance on a subdomain
no. u will have to create one from cpanel. Do u have cpanel access?
 
Ya I create in cpanel but when I open it gives not register domain
It's very awkward sir
Hahahaha
 
Sid
does the not register message appear while creating or after creation?
 
No, when I create the subdomain that's looks smooth with no problems but when I hit the subdomain.example.com in browser it gives mercusuar.co.id it means the domain is not registered
 
Sid
thats weird
i will need to take a look myself
 
Ya it's weird
 
Sid
7:09 AM
share your cpanel details it thats okay wid you.
 
That's the problem I cannot share my cpanel access because my boss not allowed me
 
Sid
oh.. thats okay. Also my desktop is really messed up or else i would have assisted you on teamviewer. Anyway, try to create a subdomain once more following these steps - inmotionhosting.com/support/edu/cpanel/cpanel-manage-domains/…
Hope this helps
 
Okay I will try it first
How could I contact you back if I need help in the future ?
 

last day (15 days later) »