saifai
08-10-2006, 12:46 AM
I'm having trouble using an htaccess file for my php based archive (http://saifai.co.uk/fanfic/index.php).
I added in an .htaccess file to make sure the index and 404 pages were set. I thought maybe I would have had to use a php.ini file or something, but others using this script use a regular htaccess file. I set the index to a regular html file and redirected it to the php index (which originally I had done it that way because I couldn't get it to work setting it to index.php).
The problem is it didn't work. When you visit either the archive root (http://www.saifai.co.uk/fanfic) or an error page (http://www.saifai.co.uk/fanfic/error) when I've got an htaccess file in there it brings up standard issue browser warnings for "forbidden" on the index and "page not found" for the 404 errors.
Currently, I've got a blank htaccess file in there which ends up pulling up code for the pages listed in the htaccess file in my site root. Visit the pages in the above paragraph and you'll see what I mean.
I've contacted my site host to see if they knew what caused the problem, and they insist it's a coding error on my part. So, here's the contents of my htaccess files for both the archive and my site root.
Archive htaccess:
DirectoryIndex /index.html
ErrorDocument 404 /404.html
Site root htaccess:
DirectoryIndex /home.shtml
ErrorDocument 404 /404error.shtml
Any ideas on why this went wrong?
I added in an .htaccess file to make sure the index and 404 pages were set. I thought maybe I would have had to use a php.ini file or something, but others using this script use a regular htaccess file. I set the index to a regular html file and redirected it to the php index (which originally I had done it that way because I couldn't get it to work setting it to index.php).
The problem is it didn't work. When you visit either the archive root (http://www.saifai.co.uk/fanfic) or an error page (http://www.saifai.co.uk/fanfic/error) when I've got an htaccess file in there it brings up standard issue browser warnings for "forbidden" on the index and "page not found" for the 404 errors.
Currently, I've got a blank htaccess file in there which ends up pulling up code for the pages listed in the htaccess file in my site root. Visit the pages in the above paragraph and you'll see what I mean.
I've contacted my site host to see if they knew what caused the problem, and they insist it's a coding error on my part. So, here's the contents of my htaccess files for both the archive and my site root.
Archive htaccess:
DirectoryIndex /index.html
ErrorDocument 404 /404.html
Site root htaccess:
DirectoryIndex /home.shtml
ErrorDocument 404 /404error.shtml
Any ideas on why this went wrong?