By default most web servers across the internet are configured to treat as PHP files only files that end with .php. In case you need to have your HTML files parsed as PHP (e.g .html) or even if you want to take it further and make your PHP files look like ASP, you can do the following:
I am planning to use php includes to rebuild my pages. Currently all my pages are .html
One suggestion was to change to .php but this will cause all links to break, including all important search listings.
Is placing this code in the htaccess file my solution ? i.e. I do not need to change the names of the files?
AddHandler application/x-httpd-php .html .htm
My tech skills are pretty low, so looking for a simple solution. I do not have access to the Apache thing on my server (which a friend suggested).
AddType x-httpd-php .php .htm .html
AddHandler application/x-httpd-php .php .htm .html
-- prevents php being read in php file (e.g. http://www.tranquillizer.co.uk/supplement-whey-protein.php)
and does nothing for .html file (e.g. http://www.tranquillizer.co.uk/phptest.html)
Do .php pages rank any differently from .html? Maybe I will go the route of renaming all pages to .php and setting up redirects. It probably will not be much more work to start with.
Do you know about mod re-writes? I came across this somewhere, but am not sure if that will help either! Still so much to learn.
You will need to ask 1and1 about their particular setup.
No, PHP files do not rank different, however if you already have your HTML files indexed it will be easier for you to add some interacitivity or dynamic content generation without losing your SE rankings.
Yes I have the same problem with 1and1. I contacted them but they will not help. Basically their responce was that I need to learn scripting, but they won't tell which kind. This is really awful responce especially that they are doing advertisement on OUR domains that we PAY for. I think a class action suit is called for!
Meanwhile I whish there was a solution to this problem.
I have alway used this method with very little problem but recently have been getting error message. I get a lot of error but it comes down to (include_path='.:/usr/lib/php:/usr/local/lib/php')
As for web hosting companies, if you want someone to hold your hand do not go for discount hosting like 1and1 or go daddy or any of cheap hosting companies. You either spend money for tech support to teach you or your time to learn how.
Sorry, if this bothers people but how exactly is a hosting company going to afford people and the time to walk you through apache mod rewrites for a few bucks a year.
Now that I got that off my chest, 1and1 and most shared hosting companies run php in cgi mode for performance reasons.
I am using a hosting service at hostgator and there
AddHandler application/x-httpd-php .html .htm
seems to work.
Truly
Aditya
www.adiwebs.com