Apache Redirect Problem

Apache Redirect Problem

Post by Tom To » Thu, 15 Jun 2000 04:00:00



Hi,

If anybody is keeping careful track of my posts, they will
probably note that this is a re-post. However, I got no
response and this time I'll be more concise.

In your apache config, inside <VirtualHost> tags:
ScriptAlias /cgi-bin  /some/home/path/cgi-bin
ErrorDocument 404 /cgi-bin/error.pl

In /cgi-bin/error.pl:
#! /usr/bin/perl
print "Location: http://www.mydeja.com\n\n";

Versions:
Apache 1.3.6 on SunOS 5.6
Apache 1.3.12 on Linux 2.2.12-20smp

This returns a blank page with the following source:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-
Type></HEAD>
<BODY><XMP></XMP></BODY></HTML>

If anyone could point out what I am doing wrong, I'd
love some pointers...
--
Cheers,
Tom

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Apache Redirect Problem

Post by Tom To » Wed, 28 Jun 2000 04:00:00


Hello again,

After discussing this by email with a very helpful person,
a simple answer was found. As the headers were wrong, the
perl cgi could look like this:

print "Status: 302\n"; # 302 - 'Temporarily Moved'
print "Location: http://www.mydeja.com/\n\n";

As usual when you don't post your complete problem, it
leads to more unforseen hickups :)
As well as 404, I am catching 401 responses. Using this method,
I no longer get an alert box (asking for username and password)
when attempting to access restricted areas of the web site.
Which is understandable behaviour. Any comments or helpful
hints appreciated.

Cheers,

Tom

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Apache Redirect Problem

Hi,

I have a problem which I think that others have bumped into before.

When I try to redirect a page to another as follows

RedirectMatch /archive/(.*)    /script.php3?Path=$1

the ? gets replaced for a %3f, (hexadecimal notation). This should be fine,
because it is according to the standard, but Apache itself can not
understand it! The result then becomes Page Not Found.

How can I accomplish this redirection? I don't want to use Rewrite, because
it doesn't change the URI, which messes up all relative paths in the
document.

Any suggestions?

Regards,
Oscar Abrahamsson

2. Cirque Wave Keyboards

3. C preprocessor

4. Apache Redirect/ReWrite for redirecting old->new domains?

5. Sun Cluster Information

6. Problems with Apache Redirect and MSIE-MSWindows 2000

7. Mail notification

8. problem with Apache's date format in redirects

9. Redirecting all problems to a single page? (Apache)

10. Help...Problem with custom apache module and redirects

11. Apache 1.2.6 .htaccess/errordocument redirect problem

12. NEWBIE: Redirect problem in apache