cancel
Showing results for 
Search instead for 
Did you mean: 

ErrorDocument 404, htaccess and the new CGI server

wallregg
Dabbler
Posts: 23
Registered: 30-07-2007

ErrorDocument 404, htaccess and the new CGI server

Hello everyone,

I'm having a problem getting an .htaccess file to work on the new CGI server. I'm trying to set up a redirect for 404 errors in a sub-directory, using:

ErrorDocument 404 /redirect.htm

However, nothing happens! Does anyone have any ideas?

Rick
6 REPLIES
N/A

ErrorDocument 404, htaccess and the new CGI server

tbh I have never been able to get that to work so if anyone can I'd also like to hear from you ! Smiley
tony2007
Grafter
Posts: 115
Registered: 15-08-2007

Re: ErrorDocument 404, htaccess and the new CGI server

Quote
Hello everyone,

I'm having a problem getting an .htaccess file to work on the new CGI server. I'm trying to set up a redirect for 404 errors in a sub-directory, using:

ErrorDocument 404 /redirect.htm

However, nothing happens! Does anyone have any ideas?

Rick


hi,

i have a htaccess currently working on the new server. it does the same thing - redirect - as you're trying to set up - and it works!. here's the code i put in the file - it looks a lot like yours!

ErrorDocument 404 http://ccgi.sociologyonline.co.uk/front_scripts/error.html


did you make sure that a) there was a '.' at the start of the name of the file name, thus '.htaccess' and that b) there is no 'extension' to the file name, e.g 'txt' (if you write the file in NotePad it will try to use .txt as the default!)
Finally I was always told to put the absolute url (not relative) in the doc and always use the html form and not htm.
Cannot think what else might be the problem.
But can confirm these files do work on the new server.
Tony
wallregg
Dabbler
Posts: 23
Registered: 30-07-2007

ErrorDocument 404, htaccess and the new CGI server

Hi Tony,

Thanks for the information. Absolute URL's are working perfectly!

Strangely, a relative URL in the site's root directory works but subdirectories will only work with absolute addresses.

Awkward little things these htaccess files, aren't they?!

Rick
N/A

ErrorDocument 404, htaccess and the new CGI server

nice one. I dont know why I have never been able to get it to work, my browser never shows the page.

I use url rewrites in .htaccess files - very powerful stuff, recommend people to look into it.
tony2007
Grafter
Posts: 115
Registered: 15-08-2007

ErrorDocument 404, htaccess and the new CGI server

Quote
Hi Tony,

Thanks for the information. Absolute URL's are working perfectly!

Strangely, a relative URL in the site's root directory works but subdirectories will only work with absolute addresses.

Awkward little things these htaccess files, aren't they?!

Rick


Good to hear you got it working
Wink
Marteknet
Grafter
Posts: 577
Registered: 13-10-2007

Re: ErrorDocument 404, htaccess and the new CGI server

Quote
I have a htaccess currently working on the new server. it does the same thing - redirect - as you're trying to set up - and it works!. here's the code i put in the file - it looks a lot like yours!

ErrorDocument 404 http://ccgi.sociologyonline.co.uk/front_scripts/error.html


But can confirm these files do work on the new server.


Hi there I am trying to get links to get links like "http://cgi.domainname/dir/file" to redirect to "http://ccgi.domainname/dir/file" or at least to "http://ccgi.domainname/index.php" but have no success.

I have put a htaccess file (with dot) in my htfiles on homepages this works with missing files links as far as "www.domainname/dir/file" is concerned but will not work with "ccgi.domainname/dir/file" or "cgi.domainname/dir/file".

should I also be putting an htaccess file on the ccgi server and if so where should I place it.