iEntry 10th Anniversary RSS Newsletter Advertising
Visit Twellow.com
Text: Decrease Font Size Increase Font Size | Print Print Article | Share: Delicious Digg StumbleUpon Post to Twitter Post to Facebook
CommentTuesday, October 12, 2004

Making PHP Read as HTML

In a recent article I wrote, I mentioned a neat way to track when Google visits your Web site.

The only problem is I got dozens of E-mails from people who used the ".html" extension on their pages who wanted to know how they could make it work on the Web site they run. I have good news. With a little work, you can make PHP readable on a HTML-based page.

This is actually more of a work around than a real answer. You should also know that by doing this, you will be pushing all of your Web pages with the ".html" extension through the server's PHP parser. Simply put, all the Web pages will be pushed through the part of the server that reads PHP code.

This could put somewhat of a strain on the server itself, but I have yet to really see a huge problem reported with it. If you have a dozen or so pages, you probably will not see a problem. However if you have thousands of pages, I would not recommend this.

All you need to do is add a line of code into your .htaccess file:

AddType application/x-httpd-php .php .html

That is it. Now will treat all the code in your pages as PHP before it displays it on the page, making my previous article now possible, even if you have a ".html" extension on your Web site pages.

Mitch Keeler is a guy who likes to help people out in his own charismatic and odd way. Instead of showing somebody how to do something, he much more enjoys having people see the problem and the solution through his own eyes. Mitch has worked as an article and content writer for various Web sites around the globe.
Mitch Keeler is also a former Customer Service Director and Customer Service Manager for a large Web hosting company. Please feel free to contact Mitch or look over his impressive resume of accomplishments.

News Tags: PHP, HTML
About the author:
Mitch Keeler is a guy who likes to help people out in his own charismatic and odd way. Instead of showing somebody how to do something, he much more enjoys having people see the problem and the solution through his own eyes. Mitch has worked as an article and content writer for various Web sites around the globe.

Mitch Keeler is also a former Customer Service Director and Customer Service Manager for a large Web hosting company. Please feel free to contact Mitch or look over his impressive resume of accomplishments.

Publish A Comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
2 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
SEARCH
Popular WPN Business Resources












Subscribe to WebProNews


Send me relevant info