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.

4 Years
Discussion Span
Last Post by tarwara

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

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

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?


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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.