PDA

View Full Version : using ".htaccess" for custom 404 error pages


ladybug
11-12-2005, 08:51 AM
Not sure I am asking this in the right catagory.... but here goes.

We know how to make a ".htaccess" file that refers to a custom 404 error page, and upload it to the hosting server.

My question concerns a site I did for an organization where each chapter makes and uploads it's own chapter site to a "subdomain" set up like this:
chaptername.domainname.net

One of the chapters wants to make thier own custom 404 error page. I told them how to make and load the ".htaccess" file to their own root directory and refer it to their custom page. But it does not seem to work. Does this only work when the ".htaccess" file is in the root directory for the whole domain? Or what?

Joe
11-12-2005, 09:07 AM
.htaccess works for any folder below where it is placed.

A .htaccess file in the 'root' dir will apply to all folders on the server. If a .htaccess file is placed within \www\subdir\,htaccess it will apply to this folder and all folders below it.

ladybug
11-12-2005, 09:38 AM
Joe,
It's ironical that you would be the one to answer my post because I was just reading your tutorial on the subject. I was looking thru my bookmarks for tutorials and found yours there. Anyway I read ".htaccess files must be uploaded in ASCII mode to your server" and it dawned on me that the chapter's webmaster was probably using Dreamweaver's built in FTP to upload and it might not be actually sending this file in ASCII mode. I uploaded it myself for them just now and it works fine now.

Your tutorials are wonderful, by the way. Thanks for sharing them with us.

Joe
11-12-2005, 11:00 AM
Joe,
It's ironical that you would be the one to answer my post because I was just reading your tutorial on the subject. I was looking thru my bookmarks for tutorials and found yours there. Anyway I read ".htaccess files must be uploaded in ASCII mode to your server" and it dawned on me that the chapter's webmaster was probably using Dreamweaver's built in FTP to upload and it might not be actually sending this file in ASCII mode. I uploaded it myself for them just now and it works fine now.

Your tutorials are wonderful, by the way. Thanks for sharing them with us.

I'm glad you find them useful :) Thanks for the kind words. I thought Dreamweaver had an AUTO ASCII function built into the FTP?