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 Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted July 27, 2007 Share Posted July 27, 2007 modrewrite (.)*\.php(.)*? $1.php5$2 Quote Link to comment 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> Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
yarnold Posted July 27, 2007 Author Share Posted July 27, 2007 It does Quote Link to comment 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) Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.