Forum Moderators: coopster
Having a huge problem trying to get my php includes to operate within .html pages.
All of my pages have the .html extension...each page has <?php include...?>. My Web server has just undergone some configuration- and .htaccess no longer works the same. I get blank spots on screen where my includes are now...I know that php is working and installed.
My .htaccess looks like this...
AddType text/css .css
AddType application/x-httpd-php .php4 .php .htm .php3 .inc .html
-------------------
Each time I add this file to the correct directory- I try and access the site only to be asked if I want to download the site.
When I remove the file, I can access the site once again- but the .inc's are still missing. The files haven't been changed since before the config- when everything was good in the hood.
I just need to get these includes working, any help is greatly appreciated.
1) Change your include($path) to a full server path eg. /usr/www/siteid/includes/file.inc
2) Copy/rename a .html file to .php and see if it now works - if it does then you may be able to work around the whole problem using mod_rewrite
3) When it prompts you to download the site - go ahead and save the file - and open it within your favourite text editor - what is it that has been downloaded?
1) Doesn't work...
2) Corrects the problem. But shouldn't I be able to use php within .html files? My host hasn't gotten back to me yet about why .htaccess causes number 3.
3) I save just the page I go to...index.html. When I open it locally- it lacks any CSS styles and just gives me the bare bones information.
Thanks again.
M
Do you get any error messages?
Can you open the files you wish to include directly from the browser?
eg. if your include file is include.html does [example.com...] open it?
Do your include files live in the document root or a sub directory?
Thanks for all your help vincevincevince and jamesa. I put the .htaccess file in my includes directory itself. Rather than the 'www'. Of course that is different than before- Last time I put the file in the 'www' directory and all was fine. I thought it effected the directory and all sub-directories unless another .htaccess file was involved in that sub...ah, i don't know.
Thank Again-