0

I have a website that uses a number of simple PHP include commands to call up scripts on multiple pages. The most simple example is the shared navigation menu that can be dynamically updated as needed and called upon with the following line of code:

<?php include("nav.php"); ?>

This has worked without issue for several years. However, our webhost (Arvixe) has just moved us to a new server and suddenly the includes have stopped working altogether. First thing I did to try to resolve the issue was upload the .htaccess file from the original server, but that has had no effect. I've been working with their support team for almost a week now, but they can't figure out what's going on and I'm not sure how to better communicate what is needed, at this point.

Here's the .htaccess file content:

AddHandler server-parsed .html
AddHandler application/x-httpd-php .html

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>

<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "max-age=0, public"
</filesMatch>

<filesMatch "\.(css)$">
Header set Cache-Control "max-age=0, public"
</filesMatch>

<filesMatch "\.(js)$">
Header set Cache-Control "max-age=0, private"
</filesMatch>

</ifModule>
# END Cache-Control Headers

Header set Set-Cookie "VC-NoCache=1; max-age=900; path=/"
Header set VC-NoCache "1"

Any idea what might have changed on their end that needs to be rectified? Thanks.

712Jefferson
  • 211
  • 2
  • 7
  • 17
  • 1
    If you view the source of your page then what do you see in the place where you have the PHP include tag? I assume nothing at all? What happens if you try – Chris Aug 28 '17 at 17:43
  • When you say "I do see the include lines" do you mean that you can see the actual PHP code? – Chris Aug 28 '17 at 17:50
  • @Chris Thanks. When I view the source, I do see the include lines. I just tried your suggestion and no message appears. However, I can see the line when viewing the source. – 712Jefferson Aug 28 '17 at 17:50
  • You see ``, or the contents of that file? – chris85 Aug 28 '17 at 17:51
  • @Chris Not on the webpage itself, but I can when using the browser's "View Source" function. Here's a direct link to the page with the code you suggested: http://www.parochialathleticleague.org/tournaments.html – 712Jefferson Aug 28 '17 at 17:51
  • `.html`? What's your htacess have? (Also not a good sign that your hosting company can't figure out what is wrong here) – chris85 Aug 28 '17 at 17:52
  • Isn't the extension of the file to be. php? – Rotimi Aug 28 '17 at 17:53
  • @Akintunde It _could_ be `.html` if handler has been correctly modified (so probably hasnt and that is the issue) – chris85 Aug 28 '17 at 17:54
  • 2
    Either you need to set the extension to be php, or tell your .htaccess to process html files as php. That's probably the difference between the two servers. – aynber Aug 28 '17 at 17:55
  • Very true @chris85 OP should show htaccess file – Rotimi Aug 28 '17 at 17:56
  • Yeah, I've been able to do this as a .html file for the last several years without issue. Just needed to change the handler in the .htaccess. By the way, I fiully acknowledge that this isn't the greatest example of coding, but it has worked effectively for us for years until the server change. Agree that it's not a good sign they can't figure it out. – 712Jefferson Aug 28 '17 at 17:56
  • 1
    If the .htaccess is the same between servers, [AllowOverride may have been set to none in the apache config](https://stackoverflow.com/questions/5210820/apache-server-ignores-htaccess) – aynber Aug 28 '17 at 18:03
  • @aynber - Very interesting! I have reached out to the webhost to check on this. Thank you. – 712Jefferson Aug 28 '17 at 18:15
  • The scope of this issue is pretty limited so your host should be able to help you/tell you what is wrong. – chris85 Aug 28 '17 at 18:18

0 Answers0