![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | Blogs | Mark Forums Read |
| Web Design Forums and discussions on webdesign |
Web Design | |||||||||
|
|
|
|
| |||||
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Civilians | I host a number of domains at a "well known hosting company" on various shared hosting plans. Most of these domains are simple static pages. Some have some dynamic content, some forms, some PHP to process the forms. What I want to do is to have PHP statements embedded in ordinary ..html file and have those PHP statements interpreted. Their httpd server (apache) is configured to interpret PHP in .phtml files as well as the obvious .php, .php4 and some others. I believe I should be able to convince apache to interpret .html files with PHP via some statement(s) in the .htaccess file. My intent is to hide from visitors to the site anything suggesting dynamic content. That is: every page seen via the location bar on their browser should be of type .html. ... Am I being unreasonable with this goal? The hosting company have been either unwilling or unable to answer a question for me. They tell me "... do this, that, or the other thing" in .htaccess to get the results I want. Alternatively, they tell me to use some other technique that I explicitly said I didn't wanna do (put it in .phtml files). Their suggestions for ..htaccess simply do not work. They have told me to add an "AddType ..." statement to the ..htaccess. It does not work. We've been going round & round for about a week now via email (no telephone support) with no resolution. Something tells me they don't want me doing this, or that the tech support folks don't know how to do it. Any help in this forum would be appreciated. "Rex" -- The name, "Rex Karz" is a pseudonym. The From: email address is a spam trap. Messages sent to that address may cause the sender's IP-address to be listed in one or more DNSBls. |
|
| | #2 (permalink) |
| Civilians | And lo, Rex Karz didst speak in alt.www.webmaster: > I believe I should be able to convince apache to interpret .html files > with PHP via some statement(s) in the .htaccess file. AddType application/x-httpd-php .html > They have told me to add an "AddType ..." statement to the .htaccess. It > does not work. We've been going round & round for about a week now via > email (no telephone support) with no resolution. Take an empty .htaccess file and add the following single line to it: RedirectMatch 410 ^.* .... and put it in your root directory. Then visit your website. If you don't get a 410 Gone response code, your server is ignoring your .htaccess file. Your host needs to do something about this. If you *do* get a 410 Gone response, there is something wrong with the syntax of whatever AddType directive you added. *You* need to do something about this. Grey -- The technical axiom that nothing is impossible sinisterly implies the pitfall corollory that nothing is ridiculous. - http://www.greywyvern.com/ringmaker - Orca Ringmaker: Host a web ring from your website! |
|
| | #3 (permalink) |
| Civilians | Rex Karz wrote: > What I want to do is to have PHP statements embedded in ordinary > .html file and have those PHP statements interpreted. This seems to work for me: AddType application/x-httpd-php .php .php3 .phtml .html -- Toby A Inkster BSc (Hons) ARCS Contact Me ~ http://tobyinkster.co.uk/contact |
|
| | #4 (permalink) |
| Civilians | GreyWyvern wrote: > And lo, Rex Karz didst speak in alt.www.webmaster: > >> I believe I should be able to convince apache to interpret .html >> files with PHP via some statement(s) in the .htaccess file. > > > AddType application/x-httpd-php .html > Doesn't work. Mozilla objects saying, in a modal dialog box: "The file ... is of type application/x-httpd-php and Mozilla does not know how to handle ...". MSIE says something similar. >> They have told me to add an "AddType ..." statement to the .htaccess. >> It does not work. We've been going round & round for about a week now >> via email (no telephone support) with no resolution. > > > Take an empty .htaccess file and add the following single line to it: > > RedirectMatch 410 ^.* > > ... and put it in your root directory. Then visit your website. If > you don't get a 410 Gone response code, your server is ignoring your > .htaccess file. Your host needs to do something about this. > didn't do this. I have an extant .htaccess file. With the suggested change above, it looks like this: AddHandler server-parsed .html AddType application/x-httpd-php .html I know that the AddHandler statement is being parsed and acted upon correctly. "Rex" -- The name, "Rex Karz" is a pseudonym. The From: email address is a spam trap. Messages sent to that address may cause the sender's IP-address to be listed in one or more DNSBls. |
|
| | #5 (permalink) |
| Civilians | Rex Karz wrote > The name, "Rex Karz" is a pseudonym. The From: email address > is a spam trap. Messages sent to that address may cause the > sender's IP-address to be listed in one or more DNSBls. Good for you. -- Charles Sweeney http://CharlesSweeney.com |
|
| | #6 (permalink) |
| Civilians | And lo, Rex Karz didst speak in alt.www.webmaster: > GreyWyvern wrote: > >> And lo, Rex Karz didst speak in alt.www.webmaster: >> >>> I believe I should be able to convince apache to interpret .html >>> files with PHP via some statement(s) in the .htaccess file. >> AddType application/x-httpd-php .html > > Doesn't work. Then you are probably running SuPHP. Try one (or both) of the following: AddType x-httpd-php .html AddHandler x-httpd-php .html Grey -- The technical axiom that nothing is impossible sinisterly implies the pitfall corollory that nothing is ridiculous. - http://www.greywyvern.com/ringmaker - Orca Ringmaker: Host a web ring from your website! |
|
| | #7 (permalink) |
| Civilians | GreyWyvern wrote: > And lo, Rex Karz didst speak in alt.www.webmaster: > >> GreyWyvern wrote: >> >>> And lo, Rex Karz didst speak in alt.www.webmaster: >>> >>>> I believe I should be able to convince apache to interpret .html >>>> files with PHP via some statement(s) in the .htaccess file. >>> >>> AddType application/x-httpd-php .html >> >> >> Doesn't work. > > > Then you are probably running SuPHP. Try one (or both) of the following: > > AddType x-httpd-php .html > > AddHandler x-httpd-php .html > > Grey > Thanks for the tip. Still does not work. The hosting company says they do NOT run PHP as a module, for security reasons. Sigh! ... I'm sure the collective wisdom of this group will provide the answer. ... Keep the suggestions coming! Thanks. -- The name, "Rex Karz" is a pseudonym. The From: email address is a spam trap. Messages sent to that address may cause the sender's IP-address to be listed in one or more DNSBls. |
|
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| htaccess rewrite code question | Allis | Web Design | 2 | 02-04-2005 16:00 |
| .htaccess - How can I pass our search keywords (e.g. from GoogleAds) past .htaccess... into our cookies!? | Shiperton Henethe | Web Design | 1 | 11-24-2004 19:00 |
| .htaccess passwords | Earthlink News | Web Design | 2 | 11-22-2004 19:00 |
| .htaccess - how big is too big? | HC | Web Design | 5 | 11-19-2004 19:00 |
| htaccess question | Grytpype-Thynne | Web Design | 5 | 07-30-2004 10:00 |
![]() | ![]() | ![]() |