![]() |
| ||||||||
|
|
#1 |
|
Active Warrior
Join Date: Apr 2007
Location: , , Ireland.
Posts: 82
Thanks: 0
Thanked 1 Time in 1 Post
|
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: 704
Thanks: 59
Thanked 63 Times in 37 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: 501
Thanks: 22
Thanked 14 Times in 7 Posts
|
|
|
Follow Me on Twitter
He who laughs last, thinks slowest. |
|
|
|
|
|
|
#4 |
|
Active Warrior
Join Date: Apr 2007
Location: , , Ireland.
Posts: 82
Thanks: 0
Thanked 1 Time in 1 Post
|
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,441
Blog Entries: 2
Thanks: 39
Thanked 119 Times in 57 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.
|
|
Come Visit Us at Don and Jeremy's Blog
|
|
|
|
|
|
|
#7 |
|
HyperActive Warrior
War Room Member
Join Date: Apr 2008
Location: Germany
Posts: 200
Thanks: 0
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: 82
Thanks: 0
Thanked 1 Time in 1 Post
|
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
Join Date: Dec 2004
Location: Greece
Posts: 8,535
Blog Entries: 1
Thanks: 703
Thanked 2,095 Times in 568 Posts
|
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
Join Date: Oct 2007
Location: Pacific, MO. USA.
Posts: 26
Thanks: 2
Thanked 0 Times in 0 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: 702
Thanks: 0
Thanked 21 Times in 3 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 | |
|
Senior Warrior Member
War Room Member
Join Date: Jul 2008
Location: Near Dallas, TX, USA
Posts: 2,198
Blog Entries: 23
Thanks: 665
Thanked 1,367 Times in 563 Posts
|
Quote:
![]() John | |
|
Adsense & Affiliate Coaching - Sign Up Today!
Free ---> How To Make Money With Adsense WSO's ---> Get Paid More For Your Articles ::: Smart Article Marketing ::: Become A Lightning Fast Rewriter ::: Article Research 101 |
||
|
|
|
![]() |
|
| Tags |
| php, redirect |
| Thread Tools | |
|
|
![]() |