Forum Moderators: phranque

Message Too Old, No Replies

php file extention

Hid the php extention, but domain.com just displays a list of files

         

nfs2

10:41 pm on Feb 23, 2006 (gmt 0)

10+ Year Member



I used the following code to hise the php file extention. I then renamed all php files dropping the php extention. And also renamed any reference to a php extention within the files.

<FilesMatch "^[^\.]+$">
ForceType application/x-httpd-php
</FilesMatch>

All worked well throughout the site. I was getting urls like mydomain.com/somefile?action=result

The problem is only when i go to mydomain.com, it simply lists files in my home directory. Im guessing this is because there is no longer an index.php file, only an index file.

Can anyone help me?

coopster

10:47 pm on Feb 23, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Add the 'index' entry to your DirectoryIndex [httpd.apache.org].
DirectoryIndex index.html.var index.htm index.html index.php index

nfs2

11:02 pm on Feb 23, 2006 (gmt 0)

10+ Year Member



Thanks, but where do i add that? The link says what it does, but not where to add it

nfs2

11:06 pm on Feb 23, 2006 (gmt 0)

10+ Year Member



Ah, i see its the mod_dir.c file.. Im guessing this is one of those files only my host has access to?

I dont run my own server

coopster

11:43 pm on Feb 23, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



It can also be set in .htaccess though.

nfs2

12:09 am on Feb 24, 2006 (gmt 0)

10+ Year Member



Ah ok cool, it works perfect now

Thanks a lot