Results 1 to 5 of 5

Thread: Running PHP scripts in .html files - GoDaddy issues

  1. #1
    Join Date
    Jul 2010
    Beans
    45

    Running PHP scripts in .html files - GoDaddy issues

    Hi everyone.

    I've been grappling with this problem for a few hours now and at this point I should probably just bite the bullet and do it the long way, but I still want to figure this out.

    Basically, I want my .html files to run PHP scripts without having to change the extensions (and thereby all internal links as well). I looked it up, and immediately found that I just need to modify/create .htaccess with:

    Code:
    AddType application/x-httpd-php .html
    I'm running Apache on my computer through XAMPP. I test a .html with PHP code and it works beautifully.

    However, when I upload them to the actual website (hosted through GoDaddy), I get problems. First, the browser attempts to download my .html files instead of displaying them. After a few hours' search, I find http://forums.digitalpoint.com/showt...84#post7483543.

    When I try that instead, the problem changes - I get a 403: Forbidden error every time I try to visit a .html file. Just to see what happens, I make a simple test.php file, and that displays correctly. So it seems to be just the .html files. There's nothing else in .htaccess denying me access. Once again, this same setup works fine locally.

    At this point, I call GoDaddy's customer support number. As expected, the actual conversation lasts less than 2 minutes - I describe my problem, he immediately says he doesn't know how to fix it but he's heard it's "hard." Yay GoDaddy (not my choice, I'm working with a group).

    So... if anyone has experienced these kind of issues, any help would be very much appreciated. Now, excuse me while I exercise my CTRL + F skills.

  2. #2
    Join Date
    Apr 2009
    Beans
    300
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Running PHP scripts in .html files - GoDaddy issues

    Quote Originally Posted by Lootbox View Post
    Code:
    AddType application/x-httpd-php .html
    Try including ".php" in your AddType directive:
    Code:
    AddType application/x-httpd-php .html .php
    Is ".htaccess" in the same directory as your script?
    Last edited by donsy; August 11th, 2010 at 04:30 PM.

  3. #3
    Join Date
    Jul 2010
    Beans
    45

    Re: Running PHP scripts in .html files - GoDaddy issues

    Quote Originally Posted by donsy View Post
    Try including ".php" in your AddType directive:
    I tried adding that as well, but ran into the same issues.

    Quote Originally Posted by donsy View Post
    Is ".htaccess" in the same directory as your script?
    It is.

    At the point I think the best solution is to convince the group's president to switch hosts when the contract expires. I guess you get what you pay for.

  4. #4
    Join Date
    Apr 2009
    Beans
    300
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Running PHP scripts in .html files - GoDaddy issues

    Quote Originally Posted by Lootbox View Post
    At the point I think the best solution is to convince the group's president to switch hosts when the contract expires. I guess you get what you pay for.
    I use http://www.inmotionhosting.com/ and highly recommend them. Their support is great, and so far no downtime.

  5. #5
    Join Date
    Jul 2011
    Beans
    1

    Re: Running PHP scripts in .html files - GoDaddy issues

    i was experiencing the same problem .just go to the root of your website and create .htaccess file and add the code below.this will work perfect

    Options +ExecCGI
    AddType application/x-httpd-php .php .html
    AddHandler x-httpd-php5 .php .html

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •