Page 1 of 1

file extension and domain redirect

New postPosted: 28 Nov 2006 22:10
by wmghori
Hi,

Can you give me a sample code for .htaccess so it will treat every .php extension file as .php5 extention in the current directory and alll the sub directories?

One other thing

with the following code
_______
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} mydomain.com
RewriteCond %{REQUEST_URI} !/mydomain
RewriteRule ^(.*)$ mydomain/$1 [L]
________

ok so i point my browser to mydomain.com its showing the following
http://mydomain.com/mydomain/index.php
instead of
http://mydomain.com/index.php

Can you tell me what i'm doing wrong in the above code.

Thanks & Regards

New postPosted: 29 Nov 2006 00:48
by produke
Add this to get .php files parsed as .php5 files
Code: Select all
AddType application/x-httpd-php .php .php5


Or use a rewriterule to make all files that end in .php be parsed as php5
Code: Select all
RewriteEngine On
RewriteBase /
RewriteRule (.*)\.php$ $1.php [L,T=application/x-httpd-php]


Or use the ForceType directive
Code: Select all
<FilesMatch "\.(php|php5)$">
ForceType application/x-httpd-php
</Filesmatch>




Notice that all of these examples use "application/x-httpd-php" as the php5 type, but it could be different depending on your web-host and php5 installation.. ie. might be "php5-cgi" if you are using a cgi'd version of php5

New postPosted: 02 Dec 2006 10:27
by wmghori
Thanks alot man