Jump to content

Why is the PHP source shown?


skeptic

Recommended Posts

When you visit this page: https://wufotos.com/testcase/index.php

you will notice the source code is shown. I assume the PHP interpreter was not invoked.

 

What prompts it to show is a .htaccess file which contains these lines:

# Use PHP5 as default

AddHandler application/x-httpd-php5 .php

RewriteEngine On

RewriteCond %{HTTPS} !on

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

 

The same combination is not a problem with BlueHost or LunarPages. It's only a problem at GoDaddy.

 

What's the problem here?

 

Patrick

Link to comment
Share on other sites

Why do you need to add that in the .htaccess in the first place? If the webserver is setup to parse PHP then you should not need that. Perhaps contacting GoDaddy Customer Support might yield some more accurate answers.

 

The best answer is that GoDaddy limits their .htaccess file or does not have php 5 installed.

Link to comment
Share on other sites

It appears this line is causing the source code to show, I am not sure why:

AddHandler application/x-httpd-php5 .php

 

The reason for the .htaccess is to force the page into https:// if it came in as http://

 

GoDaddy has PHP 5.2.8. That line is redundant in 5.2.8, but shouldn't cause it to break.

 

Why do you need to add that in the .htaccess in the first place?

Link to comment
Share on other sites

  • 3 weeks later...
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.