Forum Moderators: phranque
I've been a lurker on these forums for a while. This is my first post.
I currently have a big problem. The front page of my website will not work. Here is what happened....
I searched for a way to add PHP code to a .html document. That's when I came upon [a tutorial page at] <snip>
The page instructed me to add the following to my .htaccess file in the root of my domain's folder:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
Now for the last three days if you try to access the main page of the site, e.g: [mysite.com...] - both IE and Firefox attempt to download the page, they see "index.htm" as an "unknown file type".
Two days ago, I simply deleted the .htaccess file. However, the problem is still there. I also removed the php code from the html documents. However, it still doesn't work.
I've waited three days in hopes that the server might refresh itself and everything would work OK again. It still doesn't work :(. I don't have access to Apache as I am on shared hosting. I can only use .htaccess.
The site is only about three months ago. It's currently in the "sandbox", so I imagine that this is really not a good time for the main page to be inaccessable.
If anyone can please advise me as to how the problem can be solved, I'll be forever grateful.
Please note: The site that I'm referring to in this thread is not the site in my profile. If you're interested in helping with this problem, please send me a private message or e-mail for the site in question (I know that we're not allowed to post our sites on Webmaster World).
[edited by: jdMorgan at 4:42 am (utc) on Mar. 31, 2005]
[edit reason] Removed URL. Please see TOS. [/edit]
That was a really quick reply. Cheers!
I added
AddHandler application/x-httpd-php .htm .html to the .htaccess file. It works when I go directly to the file, e.g: "http://www.mysite.com/index.htm" or "http://www.mysite.com/index.html"
But when I try going to "http://www.mysite.com" - the browser still attempts to download the page. The page that it attempts to download is the old version from two days ago (the one that had the PHP code in it) :/. I don't understand why it keeps serving that page which is two days old. I have tried deleting all cached information in IE and Firefox. I've also tried accessing the page from a different computer.
Welcome to the forum - glad you de-lurked!
If you have permission to use mod_rewrite, this might be a quick-fix:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^/?$ /index.htm [L]
There is probably a more elegant solution, but this might work for a quick-fix to get the pressure off.
Jim
Thanks for the welcome to the non-anonymous side of Webmaster World :).
I appreciate the suggestion for a temporary solution. I added the rewrite rule to my .htaccess file (yes, my host supports mod_rewrite). However, it doesn't fix the problem that I'm having when someone goes to "http://www.mysite.com".
At this point, I really understand why the server won't redirect to index.htm. It also doesn't seem to make sense how the server is giving the the version of the page that's two days old!