index.html / index.php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

mikeycorn
Forum Newbie
Posts: 23
Joined: Thu Jun 23, 2005 9:27 pm

Post by mikeycorn »

trukfixer wrote:where, exactly is teh file *in relation to* your index.html ? - See my post above - your .htaccess should be put in the same directory as your index.html

try that and see..

if that doesnt work, your host probably has the "AllowOverride" directive set to off... which means you are stuck with whatever they set in the Apache configuration
Okay, now I got it. It's right alongside the index.html file - no dice. Looks like they have the AllowOverride directive set to off.

Thanks for the help though, I'm sure it will come in handy with other hosts.
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

mikeycorn wrote:Okay, I made a file called htaccess
ensure the file is called '.htaccess' the dot is very important. Dependant on your editor, you may have to quote the filename when saving i.e. ".htaccess"
mikeycorn
Forum Newbie
Posts: 23
Joined: Thu Jun 23, 2005 9:27 pm

Post by mikeycorn »

Wow, sharp eye there, thanks. I finally got it right, but still no dice. I'll have to check that out with some of my other hosts and see if I can get it to work.
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

It may be that that particular directive is not allowed, you could also try..

Code: Select all

<Files index.html>
ForceType application/x-httpd-php
</Files>
..or it may just be that your initial conclusions are right and they don't allow any use of .htaccess
mikeycorn
Forum Newbie
Posts: 23
Joined: Thu Jun 23, 2005 9:27 pm

Post by mikeycorn »

You meant make that the contents of the .htaccess file instead right?

Yep, still no dice. What a bunch of tight-wads for setting it up like that.
bla5e
Forum Contributor
Posts: 234
Joined: Tue May 25, 2004 4:28 pm

Post by bla5e »

Jcart wrote:

Code: Select all

AddType application/x-httpd-php .php .phtml .php3 .php4 .php5 .html
This will allow PHP to be parsed in the file. I hope I understood this time ;)
never thought of that.. cool trick!!
Post Reply