Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 12-18-2009, 04:54 PM   #1
copy and paste geek
War Room Member
 
Join Date: Jan 2005
Location: Calgary
Posts: 1,390
Thanks: 68
Thanked 168 Times in 140 Posts
Default Can't use php includes on .html pages? Say it ain't so! Best work around?

I have a site that has 35 pages with more coming up. Always thought I would just switch over to php includes when the pages got to be too many to change the navigation easily. Thought the time had come and started looking around to find out how to do that and then find out that I need a .php extension instead of .html on all the pages.

Nearly all of these pages have back links and I really hate to clog up the files with that many redirects. Has anyone else gone through this and can suggest another way to make the change over?

And another related dumbie question, maybe I should start all sites with .php file extensions, even if I'm not using any php to begin with? I don't suppose it hurts anything to just use html for a .php page?

The things that can go wrong (!)

../lloyd

There are 10 types of people, those that understand binary and those that don't.
The KimW WSO
Lloyd Buchinski is online now   Reply With Quote
Old 12-18-2009, 05:01 PM   #2
People Know Me
War Room Member
 
aaron_nimocks's Avatar
 
Join Date: Sep 2006
Location: Virginia Beach
Posts: 667
Thanks: 21
Thanked 129 Times in 111 Posts
Social Networking View Member's FaceBook Profile 
Contact Info
Send a message via Skype™ to aaron_nimocks
Default Re: Can't use php includes on .html pages? Say it ain't so! Best work around?

Try putting this in .htaccess

PHP Code:
AddType application/x-httpd-php .html .htm 
aaron_nimocks is offline   Reply With Quote
Old 12-18-2009, 05:04 PM   #3
Tim The Toolman Brechbill
War Room Member
 
ocmnet's Avatar
 
Join Date: Aug 2005
Location: Omaha, Nebraska
Posts: 58
Thanks: 5
Thanked 2 Times in 2 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via Skype™ to ocmnet
Arrow Re: Can't use php includes on .html pages? Say it ain't so! Best work around?

Add this to your .htaccess file in your home directory

# The following will make php files will work with a htm(l) extension
AddType application/x-httpd-php .html .htm


If you don't have a .htaccess file, create one and include the following:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# The following will make php files will work with a htm(l) extension
AddType application/x-httpd-php .html .htm

<Files php.ini>
order allow,deny
deny from all
</Files>

ocmnet is offline   Reply With Quote
Old 12-18-2009, 05:06 PM   #4
HyperActive Warrior
War Room Member
 
Join Date: Nov 2008
Posts: 121
Thanks: 3
Thanked 16 Times in 14 Posts
Default Re: Can't use php includes on .html pages? Say it ain't so! Best work around?

Hey Lloyd,
had a bit of a poke around the old interweb for you and found this -
How to Redirect index.html to index.php | CSS-Tricks

Not sure if it's exactly what you're looking for, but it might help you get there.

Take it easy!
JackTheLad is offline   Reply With Quote
Old 12-18-2009, 05:08 PM   #5
The Dedicated Helper
 
victorroestad's Avatar
 
Join Date: Dec 2009
Location: Norway
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Contact Info
Send a message via MSN to victorroestad
Default Re: Can't use php includes on .html pages? Say it ain't so! Best work around?

Hi Loyd.

I found something that might help you:

This technique will only work if your Apache server has PHP enabled and .htaccess enabled. Do a search in google for "how to test php support in apache http server" to find out how to test this.

In the root directory of your html files create a file named .htaccess. The file may already be present.

Open the file in your favorite editor and add the following lines:

addtype application/x-httpd-php .html
addtype application/x-httpd-php .htm

Done!


Warmest regards,

Victor A. Roestad

Get "Down 'n Dirty" in MLM
The REAL Truth About Network Marketing
www.GetSuccessIn10Steps.com
victorroestad is offline   Reply With Quote
Old 12-18-2009, 08:21 PM   #6
copy and paste geek
War Room Member
 
Join Date: Jan 2005
Location: Calgary
Posts: 1,390
Thanks: 68
Thanked 168 Times in 140 Posts
Default Re: Can't use php includes on .html pages? Say it ain't so! Best work around?

Thanks everyone. A lot of this sounds really good.

I can see that I have to start way back with a php template and redo the site a bit and it is going to be Tuesday before I can even start working on it. (Day job for the next 3 days.) Turns out I had just assumed I could add a bit of php to an html site but from a bit of reading today that doesn't seem true anymore.

Does anyone happen to know if I loose page rank with these redirects? If so I might just tough it out and leave it up as html, maybe start another site for new material.

There are 10 types of people, those that understand binary and those that don't.
The KimW WSO
Lloyd Buchinski is online now   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Tags
html, includes, pages, php, work

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 12:01 PM.