Jump to content

.php => .php5


yarnold

Recommended Posts

Hi all

 

At the moment, my client's web host only supports PHP5 when using .php5 as the file extension.

 

For the moment I have worked around this by using .htaccess to rewrite .php to .php5.

 

However, this means that whenever I upload the site to the server, I must go through all of the files directly accessed and change the file extensions to .php5.

 

I was wondering if there is a line I could put into .htaccess to make apache "think" that .php extension files ARE .php5?

 

Cheers for any help

 

Ed

Link to comment
Share on other sites

Does that not do the same as what I have in my .htaccess file at the moment?

 

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([_a-zA-Z0-9]+).php $1.php5 [L]
</IfModule>

Link to comment
Share on other sites

AddType application/x-httpd-php .php

 

You could put that in your .htaccess file.

 

(It uses the Module: mod_mime.c)

 

This is spot on for what you need as long as your host as the required module and allows you to change them. I advise you put this in your public_html file

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.