Go Back   Trackpads Community > General Discussions > Computer and Technology > Web Design

Web Design Forums and discussions on webdesign

Web Design

Reply
 
LinkBack Thread Tools
Old 02-23-2005, 16:00   #1 (permalink)
Rex Karz
Civilians

 
Default .htaccess question

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.

 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Trackpads Information
Click to Visit
Old 02-23-2005, 16:00   #2 (permalink)
GreyWyvern
Civilians

 
Default Re: .htaccess question

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!
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-23-2005, 20:00   #3 (permalink)
Toby Inkster
Civilians

 
Default Re: .htaccess question

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

 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-23-2005, 20:00   #4 (permalink)
Rex Karz
Civilians

 
Default Re: .htaccess question

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.
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-23-2005, 20:00   #5 (permalink)
Charles Sweeney
Civilians

 
Default Re: .htaccess question

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
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-23-2005, 20:00   #6 (permalink)
GreyWyvern
Civilians

 
Default Re: .htaccess question

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!
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-23-2005, 20:00   #7 (permalink)
Rex Karz
Civilians

 
Default Re: .htaccess question

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.
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


Community Information
Options
Quick Options
Trackpads Non-Commercial Ad
Copyright Information Click to Visit
Time
Server Time
All times are GMT -4. The time now is 10:52.
Copyright
Copyright Information
The header is based off of work by Vipixel.com and modified by this site. Trackpads and the Trackpads Logo are both Registered Trademarks of Jason Edwards and cannot be used without prior written permission.  The only exception is as a link back to this site. Trackpads is a private website run by a small legion of volunteers, 3 dogs, 12.5 cats and an army of small, super smart, bio-engineered mice with pointy hats and tutu's. Search Engine Friendly URLs by vBSEO 3.2.0 RC7
Archive Links
Archive Links
Page generated in 0.97467 seconds with 19 queries