PDA

View Full Version : Editing htaccess file problem



valwilson
06-11-2009, 09:31 PM
I want to add text to my htaccess file for keyword tracking purposes (the keyword tracking software I am using does not work for .html pages, only .php, so I'm told I need to add the following code:

AddType application/x-httpd-php .html
AddHandler x-httpd-php .html

This is not in my main domain, but in various add on domains, so I created an htaccess file in each add on domain folder & added the above text.

I did this on one of my add on domains (www.ovariancystshealed.info (http://www.ovariancystshealed.info)) with no problem, but when I tried it on another, then something strange happened. When I tried to open the home page (www.biggerbetterman.com (http://www.biggerbetterman.com)) it immediately tries to download a file called biggerbetterman_com (which doesn't exist) & it is not possible to open the page.

I have now deleted the htaccess file, but this has not solved the problem.

How do I stop this happening, & why did it corrupt one domain but not the other?

Any help really appreciated.

Val

travlinman
06-11-2009, 09:59 PM
Hi Val,

I can not really help you with this question, but I was wondering....

If I understand you correct, the keyword tracking software works for .php pages...so why not you just save your pages as php instead of .html?

I imagine you would avoid a lot of headaches.

Open the page properties ==> general tab ==> change file extension to "php"

valwilson
06-11-2009, 10:46 PM
Hi Travlinman,

I didn't know that I could do this. I've been pulling my hair out on this one, & that definitely would solve my problem, so thank you, thank you, thank you!

Val

valwilson
06-12-2009, 08:39 AM
Just as a follow up to this, if I change my home page from index.html to index.php, & someone has saved it in their favorites when it was .html, will the link still work when I change it to .php? And are there any other problems with changing an already established web site from html to php that I might run into?

Thanks again for your help,

Val

Karen Mac
06-12-2009, 03:59 PM
As long as they have saved it as your dot com it will be fine

Karen

valwilson
06-12-2009, 08:09 PM
Thanks Karen.

Val

Watdaflip
06-12-2009, 08:18 PM
Well this line of the .htaccess file tells the server to execute all html files as a .php

AddHandler x-httpd-php .html

Which is meant to prevent you from having to manually change all of your pages to .php and updating all links, as well as bookmarks.

Have you tried to see if only putting the htaccess file in your public_html works on all your domains? I know that all child directories will load its parent directories htaccess files, I just don't know if the server will take into effect addon domains.