I have a website that is build in WordPress.
I want to build the sub-domains for the site according to the states same as “olx.in” do for different cities.
Everything is setup from the code, server and hosting side, but the problem I am facing is that when I type any sub-domain in the URL like “rj.mysite.com” then I there is somewhere somthing written in the wordpress php file, that is redirecting me to the main domain because I made many changes in the .htaccess file but nothing worked out.
I have tried so much but couldn’t found the script that is redirecting the sub-domains to the main domain.
Can anybody please tell me that what should be there in the php code of WordPress that is redirecting my sub-domains to the main site?
just found the answer today, hope you’ve solved it, assuming you have,
what i did for mine was create another wp-config.php file, named it wp-config-sub.php, then in your sub domain, require the wp-config-sub.php file, instead of the wp-config.php file,
then go back to your wp-config-sub.php file and comment out these lines
hope this will solve your problem. 🙂
if everything correct in the NS records and the domain redirects
I think you need to login to wordpress and change in the general settings
WordPress Address (URL)
and
Site Address (URL)
to your sub domain or to check your .htaccess file