SixthSense
12-06-2001, 10:24 AM
i want to setup custom error pages on the virtual domians
i want a detailed know how of the code that goes in the .htaccess file and other files need to be modified or uploaded
i tried searching the forum but its too confusing for me
if someone can make a clean post about how to create that
that would make my work a lot easier
as i dont want to screw up my raq
any help is appreciated
Pilgrim
12-06-2001, 09:43 PM
Oh, don't worry. You can't screw up your raq with this one. You don't have to edit any essential files or anything so drastic.
Just create a .htaccess and drop it in the directory of the virtual domain you want it to use for. (upload it with FTP)
Put this in your .htaccess:
<Limit GET>
order deny,allow
allow from all
</Limit>
ErrorDocument 400 /error.html
ErrorDocument 401 /error.html
ErrorDocument 400 /error.html
ErrorDocument 403 /error.html
ErrorDocument 404 /error.html
You can replace the error.html with any name you want. So you can have different pages for each error msg. Just make sure the error.html (or whatever you call it) file exists.
Easy huh ;)
SixthSense
12-07-2001, 10:54 AM
but i cant upload the .htaccess file in any of the sites root web folder it gives me error permission denied
and all the root web folder of each site has already a .htaccess file in them which has something like this in them
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.xx***********
AuthUserFile /home/sites/sitex/web/_vti_pvt/service.pwd
AuthGroupFile /home/sites/sitex/web/_vti_pvt/service.grp
Pilgrim
12-07-2001, 08:09 PM
I don't see why it would create a permissions problem, but if you already have a .htaccess just add
ErrorDocument 400 /error.html
ErrorDocument 401 /error.html
ErrorDocument 400 /error.html
ErrorDocument 403 /error.html
ErrorDocument 404 /error.html
to what you already have
SixthSense
12-08-2001, 04:26 AM
thats the problem pilgrim
i cant edit the file :(
should i login as su
and then edit the file to include what u told me
shortfork
12-08-2001, 07:39 AM
I think maybe the fact that you are using front page extensions might make this a problem.. (doing as above)
What I've done is add the following to my /etc/httpd/conf/httpd.conf file..
find the virtual site you want to do this to and below the lines
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site7/users/$1/web/$3
add:
ErrorDocument 401 http://www.yourdomain.com/whateverfolder/401.htm
ErrorDocument 404 http://www.yourdomain.com/whateverfolder/404.htm
ErrorDocument 403 http://www.yourdomain.com/whateverfolder/403.htm
Then you can add anything you like to the error pages.. especially a link back to the main page of the site is helpful..
Of couse, yourdomain.com is the acutal domain, whateverfolder is going to be whatever you name it.. (I use "error")
Above is suggested with no guarantee of success.. in other words.. I take no responsiblity for you breaking your box :D
(standard disclaimer)
It worked for me..
Good idea is to do below before you mess with any of the major config files on the server!!
cp filename.extension filename.extension.bak
Then hack away at the original... if you hose something..
mv filename.extension filename.extension.goof
mv filename.extension.bak filename.extension
Viola... you are back to where you started..
Shortness