httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Wigg <p...@philipwigg.co.uk>
Subject [users@httpd] Help with redirects and port-forwarding.
Date Wed, 16 Dec 2009 10:38:20 GMT
Hi,

I'm using Apache/1.3.36 and I don't have any room to change the
version at the moment. I have a separate Virtual Host listening on
port 8001:-

<VirtualHost *:8001>
    DocumentRoot "/opt/apache_1.3.36/htdocs"
    ServerName www.example.co.uk
    ErrorLog /var/log/http/example_error_log
    TransferLog /var/log/http/example_access_log

    RewriteCond %{REQUEST_URI} !^/portal.*
    RewriteCond %{REQUEST_URI} !^/static.*
    RewriteCond %{REQUEST_URI} !^/graphics.*
    RewriteCond %{REQUEST_URI} !^/css.*
    RewriteCond %{REQUEST_URI} !^/cgi-bin/.*
    RewriteCond %{REQUEST_URI} !^/favicon.ico
    RewriteCond %{REQUEST_URI} !^/robots.txt
    RewriteRule ^(.*)$ /portal [R=301]
</VirtualHost>

There is a firewall which is port-forwarding from port 80 to port 8001
on the web servers. The problem is that Apache is constructing
self-referential URLs with the 8001 port number. For example, it's
redirecting from http://www.example.co.uk to
http://www.example.co.uk:8001/portal which is not what I want, I want
it to keep port 80. I have tried using 'UseCanonicalName off' inside
my Virtual Host block to no avail (UseCanonicalName is turned on in
the main host block).

Are there any other suggestions other than writing explicit redirects?
Would UseCanonicalPhysicalPort fix my issue if I were using a later
version?

Cheers,
Phil.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message