| | #1 |
| Advanced Warrior War Room Member Join Date: 2005 Location: , , .
Posts: 635
Thanks: 48
Thanked 86 Times in 55 Posts
|
What I want is for my .html files to be parsed as if they are .php I have tried adding to the .htaccess : AddHandler x-httpd-php .html .htm and AddHandler application/x-httpd-php .html .htm and AddType application/x-httpd-php .html .htm The last one actually causes the browser to want me to open it with an application so I know that the .htaccess is being read. I have also tried adding via the cpanel apache handler. But it is not parsing it as .php. So, for example if I use the code: <?='hello'?> It is showing as that in the source code. Any help? Thanks, Ben Shaffer |
| | |
| |
| | #2 |
| From IT to IM War Room Member Join Date: 2009 Location: The World Is Flat
Posts: 37
Thanks: 36
Thanked 5 Times in 5 Posts
| |
|
.
| |
| |
| The Following User Says Thank You to Voon For This Useful Post: |
| | #3 |
| Advanced Warrior War Room Member Join Date: 2005 Location: , , .
Posts: 635
Thanks: 48
Thanked 86 Times in 55 Posts
|
Thanks. Weirdly, this is causing the browser to ask how to open the file. Any other suggestions? Ben Shaffer |
| | |
| |
| | #4 |
| HyperActive Warrior War Room Member Join Date: 2009 Location: Berwick, Melbourne, Australia
Posts: 156
Thanks: 5
Thanked 47 Times in 28 Posts
|
Ben - what hosting are you using? I've given the same solutions as above in one of my installation guides for my dynamic link cloaking - as an aside and I've not actually tried it... naughty me! So naturally I'm concerned as it appears it don't work on some hosting servers! I scoured Google on this and there are others ( strangely enough ) experiencing the same problem you are seeing. Some - and I'm only regurgitating what some folk reckon works - suggest the following. Code: AddType application/x-httpd-php .php .htm .html AddHandler x-httpd-php .php .htm .html I'd contact your hosting techs and see what light they can shed on this.. Let us know what you find! I'd certainly be interested. Cheers Tim |
|
Great Success is built from many little successes! http://www.timbrownlaw.com - My Wee Part of the World. http://www.LookingOverMyShoulder.com | |
| |
| | #5 |
| Advanced Warrior War Room Member Join Date: 2005 Location: , , .
Posts: 635
Thanks: 48
Thanked 86 Times in 55 Posts
|
Hi Tim, I just bought a site so am currently on their dedicated server with my own cpanel. Not really sure a lot more than that apart from the following pasted from cpanel: Hosting packagestandardServer NamehostcPanel Version11.24.5-STABLEcPanel Build38506Themex3Apache version1.3.41 (Unix)PHP version5.2.6MySQL version5.0.85-community- log Architecturei686Operating systemLinux I tried what you said and it had the same problem - asking which app to open it with. All I really want to do at this point is to use includes from the header and footer. Perhaps there is another way to do this without changing the file extension? Ben Shaffer |
| | |
| |
| | #6 |
| VIP Warrior War Room Member Join Date: 2006 Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
| |
| |
| | #7 |
| Advanced Warrior War Room Member Join Date: 2005 Location: , , .
Posts: 635
Thanks: 48
Thanked 86 Times in 55 Posts
|
Kirk, Forgive me if I am mistaken, but are you not just repeating what I said in my original thread? B |
| | |
| |
| | #8 |
| VIP Warrior War Room Member |
For web servers using PHP as apache module: Code: AddType application/x-httpd-php .html .htm Code: AddHandler application/x-httpd-php .html .htm You can also try Code: Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*).htm$ $1.php [NC] Code: Options +FollowSymlinks RewriteEngine on RewriteRule ^(.+).htm$ http://yourdomain.com/$1.php [R,NC] Code: RewriteRule ^(.+).htm$ http://yourdomain.com/$1.php [R=302,NC] ![]() Code: RewriteRule terms.html terms.php |
| |
| | #9 |
| Active Warrior War Room Member Join Date: 2004 Location: Florida
Posts: 68
Thanks: 21
Thanked 20 Times in 16 Posts
|
If your host is running php version 5, you should try: AddType application/x-httpd-php5 .html .htm |
| |
| | #10 | |
| HyperActive Warrior War Room Member Join Date: 2009 Location: Berwick, Melbourne, Australia
Posts: 156
Thanks: 5
Thanked 47 Times in 28 Posts
|
I've had a very quick "Squiz" over this and it looks like the answer is in there.. WWW FAQs: How do I include one HTML file in another? It would still be good if we can get your PHP issues sorted. Cheers Tim | |
|
Great Success is built from many little successes! http://www.timbrownlaw.com - My Wee Part of the World. http://www.LookingOverMyShoulder.com | ||
| |
| | #11 |
| Knowledge Seeker War Room Member Join Date: 2007 Location: Greenville , SC , USA.
Posts: 63
Thanks: 32
Thanked 20 Times in 15 Posts
|
Hey Ben Here's a software tool PhpActivator that will help you out. "O Yeah" it's free PhpActivator Michael |
| |
| | #12 |
| WPDeveloper.com War Room Member Join Date: 2009 Location: Online
Posts: 88
Thanks: 2
Thanked 9 Times in 7 Posts
|
Check your PHP version & use appropriate handlers with it version like php3 or php5
|
| | |
| |
| | #13 | |
| Lisa Dozois War Room Member Join Date: 2006 Location: Florida, USA.
Posts: 608
Thanks: 107
Thanked 254 Times in 118 Posts
|
where you have Code: <?='hello'> Code: <?PHP='Hello';?> Code: AddHandler x-httpd-php .html .htm AddHandler php-script .php .html .htm AddHandler php5-script .php .html .htm AddType application/x-httpd-php .htm AddType application/x-httpd-php .html | |
|
-- Lisa G
| ||
| |
| | #14 |
| HyperActive Warrior War Room Member Join Date: 2009 Location: Berwick, Melbourne, Australia
Posts: 156
Thanks: 5
Thanked 47 Times in 28 Posts
| |
|
Great Success is built from many little successes! http://www.timbrownlaw.com - My Wee Part of the World. http://www.LookingOverMyShoulder.com | |
| |
| The Following User Says Thank You to Tim Brownlaw For This Useful Post: |
| | #15 | |
| Lisa Dozois War Room Member Join Date: 2006 Location: Florida, USA.
Posts: 608
Thanks: 107
Thanked 254 Times in 118 Posts
|
Thanks, Lisa | |
|
-- Lisa G
| ||
| |
|
| Bookmarks |
| Tags |
| html, parsing, php |
| |