apacheperlhttp-redirectawstats

Apache redirect to perl script


I'm currently using Apache's vhosts configuration to redirect request to the server, e.g.

<VirtualHost IP:80>
ServerName http://domain.info
Redirect / http://otherdomain.com
</VirtualHost>

<VirtualHost IP:80>
ServerName http://subdomain.domain.info
Redirect / http://domain:port
</VirtualHost>

Now I installed AWstats which can be started by using the command

http://localhost/cgi-bin/awstats.pl

I assume that if I add this block to vhosts

<VirtualHost IP:80>
ServerName http://stats.domain.info
Redirect / http://domain.info/cgi-bin/awstats.pl
</VirtualHost>

I can remote-access AWstats using

http://domain.info/cgi-bin/awstats.pl

but all I get is

http://otherdomain.comcgi-bin/awstats.pl

What am I doing wrong?

Greetz holgrich


Solution

  • The question is still open, but for now I used a workaround:

    <VirtualHost IP:80>
    ServerName http://domain.info
    [Redirect to local html that contains frame forwarding]
    </VirtualHost>
    
    <VirtualHost IP:80>
    ServerName http://subdomain.domain.info
    Redirect / http://domain:port
    </VirtualHost>
    

    Now this works

    <VirtualHost IP:80>
    ServerName http://stats.domain.info
    Redirect / http://domain.info/cgi-bin/awstats.pl
    </VirtualHost>
    

    So that I can remote-access AWstats using

    http://domain.info/cgi-bin/awstats.pl