.htaccess

    Date: 07/25/07 (Web Development)    Keywords: php, browser, html, web, hosting

    So I recently changed the extensions of all of my web pages from HTML to PHP. This was good because I could finally do proper headers without the validator bugging out at me. Unfortunately, it also means I have twice the number of files in my directory - those with .html extensions and those with .php. The HTML files are needed to say "Oh yeah hey just change the extension of the page you're looking at to .php and you're good to go". The easy way to fix this, I thought, was to delete all of the HTML pages and set up a custom 404 page that could say the same thing with just one file, but as of yet it hasn't quite worked. I made a .htaccess file that says the following:

    ErrorDocument 404 404.html

    With 404.html being the 404 page, obviously. I uploaded them both into my directory (I don't have my own domain; someone's hosting me but I kinda haven't talked to my hostess in a while) and the files are... well, there, but if I go to a made up address it just gives me the default 404 page. Anyone know what's wrong? I read somewhere that the permissions have to be set to 644, and I think they are - when I go to the chmod command after right clicking on a file I get rw-r--r-- (er sorry if my syntax is wrong, but yeah it's 644). However, if I click OK, WS_FTP gives me this error: 500 'SITE chmod 644 .htaccess': command not understood ! Chmod failed. It may not be supported on remote host.

    I'm not really sure if that's relevant to anything, since it seems like it's 644 anyway, but... yeah. Also I'm not entirely sure if this is an error but if I type in the URL of the .htaccess file into the browser (http://www.example.com/directory/.htaccess) it says it can't find the file, even though I know it's there.

    Sorry for the long post, but yeah hopefully someone can help me...?

    Source: http://community.livejournal.com/webdev/424232.html

« PHP survey: Firefox/Vista... || Colour Help!~ »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home