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
https://forums.phpfreaks.com/topic/184549-why-is-the-php-source-shown/
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.

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?

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.