0

Wordpress is installed my root directory(/root/). I have a subdomain(dammani.techbrij.com) and I want to access some files of main domain from sub domain. I have done following thing:

include_once('/root/wp-config.php');
include_once('/root/wp-load.php');
include_once('/root/wp-includes/wp-db.php');

Now, "http://techbrij.com/dammani" is working fine, but "http://dammani.techbrij.com" not working. It redirects to main domain.

If i give any wrong path in include_once, I'm getting error without redirect. Let me know how to fix this issue.

Edit: I'm using same database for my app. So i want to use same wpdb functionality for subdomain.

1
  • It would be helpful to explain why you're including those files so anyone answering is in a better position to advise you on alternative methods. It may even serve as a better question to ask "How do i X" (whatever you're attempting to do) rather than "I did X and it caused Y, how do i fix it"...
    – t31os
    Commented Feb 2, 2011 at 15:45

1 Answer 1

1

I am not sure if that is cause of your issue, but you do not load WordPress in correct way.

Please see Integrating WordPress with Your Website in Codex for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.