Web Hosting Talk







View Full Version : .htaccess help


joesmoh
09-13-2001, 07:29 PM
Hi,

I want to make it so people will be redirected to the main page index.php when they have a missing page. I've done this when they go to a page such as http://mydomain.com/dajildsjlasdkad will redirect to http://mydomain.com/index.php. However, if they put something fake like http://mydomain.com/dasjkldas.cgi it gives an ERROR instead of redirection and they can see the directories on my server. How do I make it redirect?

Anyone know of any other extensions that will give errors instead of redirections? I don't want my visitors snooping around the drives!

thanks!!

CmptrWz
09-13-2001, 08:10 PM
CGI-Wrap has it's own error page. That is most likely your problem.

joesmoh
09-14-2001, 06:40 PM
CGI-WRAP, eh?

How do I get to the directory of this "Cgi-wrap"? and how do I configure the page?

thanks!

madsere
09-14-2001, 08:07 PM
You don't need to reconfigure cgiwrapper. You need to update your .htaccess.

If you add somthing like the following people are redirected to your index page whenever they get a missing page or error:

ErrorDocument 401 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php

//Rene

CmptrWz
09-14-2001, 08:47 PM
I must disagree. CGI-Wrap has it's own error, even if the page is not found! And I don't know where it is located. You could turn it off though, but if someone else can upload scripts I wouldn't recommend it.

If Allowoverride is set to all or the one for file settings is active you can add this to the .htaccess file to disable CGI-Wrap:

AddHandler cgi-script .cgi
AddHandler cgi-script .pl