Jump to content

.htaccess file help


$Three3

Recommended Posts

Hi, I am tryng to configure my server to parse HTML files as php. I just don't know where to put the .htaccess file on my server. I don't have root access on my server since I am on a shared hosting plan with GoDaddy. Any help in the right direction would be great. Thanks a lot in advance for the help.

 

So would I just create an .htaccess file and add this one line?

 

AddType application/x-httpd-php .html

Link to comment
Share on other sites

RemoveHandler .html .htm

AddType application/x-httpd-php .php .htm .html .phtml

 

ok awesome. And would I just put that in the directory where I upload my files tithe server? And does that work for the whole server or just the directory that it is in? Also, do I have to restart my server? Thanks again

Link to comment
Share on other sites

If its your own server just edit the httpd.conf file and add the extensions to the addType line, save the file and restart apache and you will not have to use an .htaccess file for each site you do.

 

 

HTH

Teamtomic

 

Hey thanks a lot for the replies. Ok I have tried everything you all have told me but when I upload the .htacces file to the www directory (the directory that is visible to the web), it does the weirdest thing. When i go to www.mysite.com/index.html it will download the index.html file. When i delete the .htaccess file, everything works perfectly again. Any one know why it is doing this?

 

Here is my .htaccess file components:

 

RemoveHandler .html .htm

AddType application/x-httpd-php .php .htm .html .phtml

Link to comment
Share on other sites

What you want to do is best done within the httpd.conf file. Find the mod_php5 block and make it look like this.

 

<IfModule mod_php5.c>

  AddType application/x-httpd-php .php .htm .html .phtml

  AddType application/x-httpd-php .php3

  AddType application/x-httpd-php-source .phps

</IfModule>

 

Thats all you have to do. Now htm/html files will be parsed by php.

 

 

HTH

Teamatomic

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.