In virtualmin I did the following :
Configure Websites -> Aliases and Redirects Map local to remote URLs
Local URL path : /google/
Remote URL : http://www.google.be/
Map remote Location: headers to local
Local URL path : /google/
Remote URL : http://www.google.be/
Seems very simple…
But I always receive the following message when browing to http://www.mydomain.com/google/ :
Forbidden
You don’t have permission to access /google/ on this server.
Any idea how I can fix this permission issue?
It’s a fresh install of Virtualmin Pro on Debian 4.0
so the most simple thing I do is to have a index.php in that folder and put this code in it:
[code:1]
<?php
header("Location: http://google.be/"«»); /* Send browser to www.site.tld /
exit; / Make sure all following code does not execute */
?>
[/code:1]
you can try :
Map local to remote URLs
Local URL path : /full/path/to/google/
I don’t think you need this at all:
Map remote Location: headers to local
Local URL path : /google/
Remote URL : http://www.google.be/
And it works fine. The browser is redirected to the google site.
However, let’s complicate things now.
Imagine that I have a website running on an internal server 192.168.1.100.
I want to redirect everything drom http://www.mydomain.com/internal to this internal server
I cannot use above php-script as the internal server is ofc not reachable from the internet and not known by internet DNS servers.
That’s where I need reverse proxying.
In virtualmin I configured this in "Server Configuration -> Proxy Paths"
URL path = /internal/
Destination URLs = http://192.168.1.100/
I see that in the apache config of my domain following is added :