![]() | | ||||||||
| | #1 |
| Active Warrior Join Date: Apr 2007 Location: , , Ireland.
Posts: 92
Thanks: 0
Thanked 3 Times in 3 Posts
|
Hi folks, I've a script that will only work in php and the site I want to use it on has html files. I don't want to change the html files because I want to use the script to track traffic. My traffic for this site comes from the search engines, so I think that if I change the file name it may eventually affect rankings. Does anyone know if - Is there a way to put php into a html file? Or alternatively, is there a way to keep my pages in the search engines but have some sort of redirect to a php file? Thanks, Dave |
| | |
| | #2 |
| Spartan Warrior War Room Member Join Date: Jul 2008 Location: PH
Posts: 903
Thanks: 122
Thanked 144 Times in 72 Posts
|
You can make HTML run PHP lines, just put the following code in your .htaccess AddType application/x-httpd-php .html |
| | |
| | |
| | #3 |
| Warrior War Room Member Join Date: Sep 2003 Location: USA
Posts: 568
Thanks: 30
Thanked 24 Times in 16 Posts
| |
| | |
| | |
| | #4 |
| Active Warrior Join Date: Apr 2007 Location: , , Ireland.
Posts: 92
Thanks: 0
Thanked 3 Times in 3 Posts
|
Hi IMB, Dennis, I'll try those and post a quick note when I get them working. Thanks a mill, Dave |
| | |
| | #5 | |
| Active Warrior Join Date: Sep 2007 Location: United Kingdom.
Posts: 40
Thanks: 3
Thanked 0 Times in 0 Posts
| Quote: This is one of those things I just not think was possible, but then again we are dealing with technology that changes daily, which is very cool, Thanks Dennis, I'll book mark this page. Hugh | |
| | ||
| | |
| | #6 |
| Donald VanFossen War Room Member Join Date: May 2008 Location: Upstate NY , USA.
Posts: 1,996
Thanks: 271
Thanked 354 Times in 173 Posts
|
The .htaccess change will work. Just remember that all html files will now be parsed as PHP whether there is PHP code in them or not.
|
| | |
| | |
| | #7 |
| HyperActive Warrior War Room Member Join Date: Apr 2008 Location: Germany
Posts: 208
Thanks: 1
Thanked 1 Time in 1 Post
|
donīt forget to backup all your files, especially the htacces file before any changes. Itīs common sense, I know. But as soon as you forget 1 time ... *Caboooom Crahs Bang bup* Martin |
| | |
| | #8 |
| Active Warrior Join Date: Apr 2007 Location: , , Ireland.
Posts: 92
Thanks: 0
Thanked 3 Times in 3 Posts
|
Hi, the code I put in my htaccess file is, AddType application/x-httpd-php htm html AddHandler application/x-httpd-php .htm .html My php scripts work fine now in html and I haven't had any problems with it. Dave |
| | |
| | #9 |
| Drunken Greek War Room Member |
And if your host is running PHP 5? Usually this will work: AddType application/x-httpd-php5 htm html AddHandler application/x-httpd-php5 .htm .html Although you may need to ask them. Another cool trick is to make all your files in PHP but use Apache's Rewrite Engine to output them at HTM or HTML file extensions |
| | |
| | #10 |
| The Earl of Marketing War Room Member Join Date: Oct 2007 Location: Pacific, MO. USA.
Posts: 40
Thanks: 4
Thanked 4 Times in 4 Posts
|
"Here's A Quick And Easy Software Tool That Will Allow You To Use PHP Code Inside Your Ordinary HTML Web Pages it's called PHP Activator" Download for Free! No you don't have to Opt-In just download. Enjoy. http://www.softwaregoldclub.com/gets...ivator_477.exe |
| More Free Advertising Than You Can Imagine! http://4trafficnow.com | |
| | |
| | #11 | |
| Advanced Warrior War Room Member Join Date: Jul 2002 Location: , , Australia.
Posts: 746
Thanks: 0
Thanked 35 Times in 7 Posts
| Quote:
But I would make a new php page and copy your old html in there... and then make your org html page redirect to the next php page... Tom | |
| | ||
| | |
| | #12 | |
| John Schwartz War Room Member Join Date: Jul 2008 Location: Near Dallas, TX, USA
Posts: 3,691
Thanks: 1,620
Thanked 3,245 Times in 1,140 Posts
| Quote:
![]() John | |
| | ||
| | |
![]() |
|
| Tags |
| php, redirect |
| Thread Tools | |
| |
![]() |