Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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 Feb 2 '11 at 15:45
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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