htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: file extension and domain redirect
PostPosted: 28 Nov 2006 22:10 
Offline

Joined: 28 Nov 2006 21:50
Posts: 2
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



Waqar Ghori
http://www.gnethosting.net


Top
 Profile  
 
 Post subject:
PostPosted: 29 Nov 2006 00:48 
Offline
User avatar

Joined: 25 Sep 2006 04:48
Posts: 242
Add this to get .php files parsed as .php5 files
Code:
AddType application/x-httpd-php .php .php5


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


Or use the ForceType directive
Code:
<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


Top
 Profile  
 
 Post subject:
PostPosted: 02 Dec 2006 10:27 
Offline

Joined: 28 Nov 2006 21:50
Posts: 2
Thanks alot man



Waqar Ghori
http://www.gnethosting.net


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB