Hello :-)
How to redirect when using a non-standard port?
Netsearching has not found an answer, perhaps because the combination of an IP- and port-based virtual server with Redirect is unusual.
Our LAN has no name service running (it's not a technical issue) so I can only use IP-based virtual hosts. The live and development virtual hosts are differentiated by port so the first lines of the virtual hosts definitions look like
Code:
<VirtualHost *:80>
and
<VirtualHost *:8080>
So far so good but the application is CGI; we need to pass CGI parameters in the URL. For flexibility and usability the live users' URL is http://<host_ID>/search which is redirected like this
Code:
<VirtualHost *:80>
CustomLog "/var/log/apache2/xapian.access.log" combined
DocumentRoot "/srv/docoll"
<Directory "/srv/docoll">
AllowOverride None
Options All
Order Allow,Deny
Allow from all
</Directory>
<Directory "/usr/lib/cgi-bin/omega/omega/">
AllowOverride None
Options None
Order Allow,Deny
Allow from all
</Directory>
Redirect "/search" "/cgi-bin/omega?DB=docoll"
ScriptAlias "/cgi-bin/" "/usr/lib/cgi-bin/omega/"
ServerAdmin <email address hidden>
ServerName "Document Collation"
</VirtualHost>
That works OK, the problem is doing the equivalent for the port 8080 virtual server. Using
http://192.168.168.51/cgi-bin/omega?DB=docoll_dev&:8080 directly works. Using '
Redirect "/search_dev" "/cgi-bin/omega?DB=docoll_dev&:8080"' and browsing
http://192.168.168.51/search_dev:8080 gets a 404. Same for '
Redirect "/search_dev" "/cgi-bin/omega?DB=docoll_dev"'.
Apache's proxy and proxy_http modules were suggested in the Xapian user mailing list but the responder did not know I was using a separate virtual host for the 8080 port and the topic had become Apache rather than Xapian so better continued elsewhere.
Best
Charles