|
|
#1 |
|
In Runtime
Join Date: Jan 2006
Posts: 236
|
Well, I got bored and decied to try and make a 404 page on my server. Google made it seem really easy. I just have to edit my .htaccess and tell it to open a certain html file when it encounters a 404. I didn't have a .htaccess in my root folder so I made a blank file and named it .htaccesss. I pasted this in the file.
ErrorDocument 404 /404page.html I saved it and then made a html file with some text in it and saved it as 404page.html. I opened a ssh and ran "sudo chmod 644 .htaccess" to make sure permssions were correct. I also restarted apache for good measure. I go to a page that doesn't exist and I get the regular 404 error. Does anyone know why this didn't work for me? This is not the first time I had problems with .htaccess. I tried to password protect a folder before using .htaccess and I couldn't do it. I just assumed that it was something I did wrong and forgot about it. I'm guessing apache isn't looking for .htaccess or something, is there something I have to enable in apache2.conf or httpd.conf? I am running apache 2.2.8 on xubuntu.
__________________
Evga 680i SLI Mobo | C2d 6420 @ 3.2 | 2gb RAM | 9800gtx | Corsair 750w | Pioneer DVD Writer | 330gb | Antec 300 Ubuntu 9.04 | Windows 7 I miss my opty :c |
|
|
|
|
|
#2 |
|
Site Team
Join Date: Mar 2004
Posts: 6,945
|
I believe (though I may be wrong).
the .htaccess files are no longer used when just left in folders, some people may choose to switch this option on, but for speed and efficiency generic tasks like this are controlled in the httpd.conf and related files. if it's your own server then there is a chance that you can switch on the option to use htaccess files, if it's a shared server either bought or free from a hosting company you may not have this option.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian… Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns. "The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries." |
|
|
|
|
|
#3 |
|
In Runtime
Join Date: Jan 2006
Posts: 236
|
I checked out my httpd.conf and my apache2.conf. Httpd.conf was there but it was empty. Apache2 has some settings but I didn't see any that were related to what I am trying to do. Are there any other conf files I should check?
In the apache2.conf file I found this, Code:
# # AccessFileName: The name of the file to look for in each directory # for additional configuration directives. See also the AllowOverride # directive. # AccessFileName .htaccess Also, yes this is my home server.
__________________
Evga 680i SLI Mobo | C2d 6420 @ 3.2 | 2gb RAM | 9800gtx | Corsair 750w | Pioneer DVD Writer | 330gb | Antec 300 Ubuntu 9.04 | Windows 7 I miss my opty :c |
|
|
|
|
|
#4 |
|
Site Team
Join Date: Mar 2004
Posts: 6,945
|
Without wanting to sound like I'm giving up, I don't have a box that has Apache on it to test this at the moment, so the manual may be more help than I am!
but I believe that the allow override would be a selection that would allow specific clients to ignore the instructions in the .htaccess file. so you could deny access to a folder to all clients, and allow override to yourself so that you can still see this. or you may use .htacess to password protect a part of your site to allow members only access, but at the same time allow override to the google search bot so that your articles are still referenced to drive traffic towards the premium part of your site. (e.g someone searches, finds a likely answer on your site and then may actually pay to access the part of your site where they know that the answer is). you may need to look to be sure that your machine you're testing from isn't allowed to override. again, reading the manual may also help. you may find that you have conflicting statements in your .conf file. so you may be setting directory permissions with .htaccess, but later saying to ignore .htaccess and allow all deny none
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian… Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns. "The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries." |
|
|
|
|
|
#5 |
|
In Runtime
Join Date: Jan 2006
Posts: 236
|
Ok, thanks for the replies. I'll check out the manual (totally slipped my mind), I'm sure I will learn a lot about setting up apache so that's good.
If anyone else has an idea let me know.
__________________
Evga 680i SLI Mobo | C2d 6420 @ 3.2 | 2gb RAM | 9800gtx | Corsair 750w | Pioneer DVD Writer | 330gb | Antec 300 Ubuntu 9.04 | Windows 7 I miss my opty :c |
|
|
|
|
|
#6 |
|
Site Team
Join Date: Dec 2002
Posts: 15,209
|
You don't setup custom error pages with .htaccess, you use errordocument in the apache conf file: http://httpd.apache.org/docs/2.0/mod...#errordocument
__________________
www.ComputerForums.org |
|
|
|
|
|
#7 |
|
In Runtime
Join Date: Jan 2006
Posts: 236
|
Thanks! Works great. I'm still going to read that manual though
__________________
Evga 680i SLI Mobo | C2d 6420 @ 3.2 | 2gb RAM | 9800gtx | Corsair 750w | Pioneer DVD Writer | 330gb | Antec 300 Ubuntu 9.04 | Windows 7 I miss my opty :c |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|