1.11M Members

Error while using include in subdomain

 
0
 

I have a domain at shared hosting which I have mapped to a folder in public html (public_html/INSURANCEGEO). Now I have created a subdomain also loacated in public html (public_html/life). Site's Header and footer files are there in 'includes' folder within my domain folder (public_html/INSURANCEGEO/includes).

I am trying to include header in my subdomain index page by writing following lines:
<?php include ('./includes/header.php'); ?>
I have also tried this also:
<?php include ('http://www.domainname.com/includes/header.php'); ?>
but same error is promting as:

Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/myhostingdomain/public_html/subdomain/index.php on line 15

Would appreciate help.

 
2
 

You need to include it with an absolute path. It's usually something like this:

include '/home/yourusername/public_html/insuranceGEO/includes/header.php';
 
0
 

Hi, Thank you very much. It is working fine but is there any other alternate way because it causing problem while giving path for header image also.
It would be greate if can explain me- How programmers handle subdomain?

 
0
 

If you mean the source for an image tag (in your HTML), then you can use a full URL.

How programmers handle subdomain

There are multiple ways to do that: you can use an alias, a CDN for shared stuff, all kinds of possibilities.

 
0
 

Thanks a lot dear

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article