htaccess help!

liunx

Guest
Now I'm new to server side scripting, so please treat me like the idiot I am.

Ok, I'm trying to setup a custom 404 error script, (seems simple enough, dosn't it?) so I read the htaccess tutorial at <!-- m --><a class="postlink" href="http://www.perlaccess.com/tutorials/File_and_Directory/Htaccess/">http://www.perlaccess.com/tutorials/Fil ... /Htaccess/</a><!-- m --> and follow the instructions there.

So I created my own 404 page (<!-- m --><a class="postlink" href="http://www.acommunity.net/404.html">http://www.acommunity.net/404.html</a><!-- m -->) and everything is going fine.

But this is where I go wrong: I create a htaccess folder and I put my 404.htaccess file in it, just like (I think) it says in the perlaccess tutorial. But it doesn't work.

I hope you can understand what I'm saying, and I hope you can help me - I'm sure it's just one stupid thing I'm doing wrong.Dave,

Try creating a file named .htaccess and put it in your root HTML directory. In that .htaccess file, you should have

ErrorDocument 404 <!-- m --><a class="postlink" href="http://www.domain.com/whatever/404.html">http://www.domain.com/whatever/404.html</a><!-- m -->

Good luck!Note that:

ErrorDocument 404
<!-- m --><a class="postlink" href="http://www.domain.com/whatever/404.html">http://www.domain.com/whatever/404.html</a><!-- m -->

should all be on one line like:


ErrorDocument 404 <!-- m --><a class="postlink" href="http://www.domain.com/whatever/404.html">http://www.domain.com/whatever/404.html</a><!-- m -->



Regards,Well I did as Unregistered said, and I placed my error page (<!-- m --><a class="postlink" href="http://www.acommunity.net/404.html">http://www.acommunity.net/404.html</a><!-- m -->) in the same directory as my .htaccess file (<!-- m --><a class="postlink" href="http://www.acommunity.net/404.htaccess">http://www.acommunity.net/404.htaccess</a><!-- m -->) but it still doesn't work. :(Dave,

make sure these things have happened:

1: your error404.html page is in the same directory as your index.html page (the root directory), not another folder or directory.

2: your .htaccess file is in the same directory as your index.html page and your error404.html page(the root directory), not another folder or directory.

3: The .htaccess is a simple text file you can create in notepad, and it reads...:
ErrorDocument 404 error404.html
you shouldn't need a fully qualified URL since its in the same directory.
it should be saved with NO FILE NAME, extension .htaccess
looks like this...:
save as: .htaccess

should work just like that. Good luck!It still doesn't work.

And I have no idea why.

The URL of my .htaccess file is: <!-- m --><a class="postlink" href="http://www.acommunity.net/.htaccess">http://www.acommunity.net/.htaccess</a><!-- m -->

And it reads: ErrorDocument 404 error404.html

And the URL of my 404 document is:
<!-- m --><a class="postlink" href="http://www.acommunity.net/error404.html">http://www.acommunity.net/error404.html</a><!-- m -->

So I don't see what I'm doing wrong!I'd suggest contacting your host. Mine had a FAQ for error404 pages, and instructions for the exact line of text that goes into the .htaccess page. It may be just a bit different for your host.in some cases, it may require you to have the .htaccess direct to files that are in the same dir as the file it's self is. be sure you dont have mutiple file copies is different or underlying dir's as this would cause a problem in some cases.

it's a head slamming good time!
chris<pixelmonkey>:monkey:I've continued to mess about with my files and I'm proud to say that it finally works!

Thanks to everyone that helped!
 
Top