Forum Moderators: phranque

Message Too Old, No Replies

htaccess and html files

HTML files not being rendered unless the extension is changed to ".php".

         

peterhufo

2:05 pm on May 24, 2011 (gmt 0)

10+ Year Member



I am ftping a .html file to a subdirectory under my domain on a remote server. There is no .htacess file in this subdirectory.

If I address the file so: "http://<domain_name>/<subdirectory_name>/<file_name>.html ", my page is not rendered, some unknown .php file is rendered instead.

If I change the extension of the file on the server from ".html" to ".php" and address the file so: "http://<domain_name>/<subdirectory_name>/<file_name>.php ", my file is correctly rendered. No surprise there. Now, this is not a bad thing as my file is being rendered, but, for several reasons, I do not want my file to be processed by the php processor.

I have looked at the code in the .htaccess file located in the directory immediately above my subdirectory. It appears to favor .php files. However, I am not an htaccess expert so I am not sure that I correctly understand the code I see.

I am hoping that there is code that i can put in a htaccess file in my directory that will say to the Apache server "html files are OK too" and will render my html without complaint.

coopster

4:10 pm on May 24, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, peterhufo.

I'm guessing you have some type of redirection going on for each request. There are tools such as the Live HTTP Headers extension (add-on) for Firefox for viewing the response headers from the web server that may be helpful. Make sure you "Show Redirects" and watch what happens.

peterhufo

6:26 pm on May 24, 2011 (gmt 0)

10+ Year Member



I do not have "some type of redirection going on for each request." as there is no htaccess file in my subdirectory.

This all taking place on a remote server where my access ends at the directory immediately above my subsirectory. As I said, I have looked at the contents of the htaccess file in the directory immediately above mine. It appears that the code there favors php files.

Unfortunately, at this time I do not have access to that htaccess file so I cannot display its contents here,

StoutFiles

6:54 pm on May 24, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You answered your own question, the .htaccess file sets the rules for that directory and all subdirectories. Why don't you have access to the root folder?