yarnold Posted July 27, 2007 Share Posted July 27, 2007 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 https://forums.phpfreaks.com/topic/61997-php-php5/ Share on other sites More sharing options...
ToonMariner Posted July 27, 2007 Share Posted July 27, 2007 modrewrite (.)*\.php(.)*? $1.php5$2 Link to comment https://forums.phpfreaks.com/topic/61997-php-php5/#findComment-308721 Share on other sites More sharing options...
yarnold Posted July 27, 2007 Author Share Posted July 27, 2007 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 https://forums.phpfreaks.com/topic/61997-php-php5/#findComment-308764 Share on other sites More sharing options...
ToonMariner Posted July 27, 2007 Share Posted July 27, 2007 I don't think yours would redirect any pages with any url data after the .php Link to comment https://forums.phpfreaks.com/topic/61997-php-php5/#findComment-308765 Share on other sites More sharing options...
yarnold Posted July 27, 2007 Author Share Posted July 27, 2007 It does Link to comment https://forums.phpfreaks.com/topic/61997-php-php5/#findComment-308782 Share on other sites More sharing options...
Crow Posted July 27, 2007 Share Posted July 27, 2007 AddType application/x-httpd-php .php You could put that in your .htaccess file. (It uses the Module: mod_mime.c) Link to comment https://forums.phpfreaks.com/topic/61997-php-php5/#findComment-308838 Share on other sites More sharing options...
Danltn Posted July 27, 2007 Share Posted July 27, 2007 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 https://forums.phpfreaks.com/topic/61997-php-php5/#findComment-308898 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.