Take the 2-minute tour ×

I've setup wiki.example.com (on the remote web server, accessible to the world) to redirect with 301 .htaccess to 192.168.1.x/cgi-bin/foswiki/view (on internal server, accessible only via the LAN).

Is there any way, either on the local or remote, that I can mask the local IP?

So the user would see


in their address bar, and not


Both are linux servers running Apache2

In response to the questions below: @Zoredache - we don't have an internal DNS server, so the fqdn doesn't get reliably resolved. I might have something wrong in the setup. You can use netbios names for the windows machines on the network just fine, but the linux machines don't respond 90% of the time.

@Dennis - Below is the current .htaccess on our remote web server

redirectMatch 301 ^(.*)$ http://192.168.1.x/foswiki 
redirectMatch permanent ^(.*)$ http://192.168.1.x/foswiki

Maybe I'm not going upon this the right way. Setting up an internal DNS Server is not an option at this time.

share|improve this question
Why are you redirecting by IP if you don't want the users to see the IP? It would be helpful to understand a bit more about why you don't simply use the correct fqdn in you redirect. –  Zoredache Sep 21 '09 at 19:46
Please post your current rewrite rules. –  Dennis Williamson Sep 21 '09 at 21:19
Did you take the redirectMatch 301 and permanent conditions off when you tried my suggestion? –  Dennis Williamson Sep 27 '09 at 14:10
yes, I tried it with only your suggestion –  shaiss Sep 29 '09 at 0:50

1 Answer 1

up vote 1 down vote accepted


RewriteEngine  on
RewriteRule    ^/?(.*)  http://192.168.1.x/cgi-bin/foswiki/$1

By not using the "[R]" it should leave the URL alone in the browser's address bar.

share|improve this answer
I think it will always redirect if you have http[s]:// in the redirect URL. –  Josh Sep 22 '09 at 2:13
That worked to redirect, however, the URL in the address bar does change to reflect the inter 192.168.1.x IP #. Any other ideas? –  shaiss Sep 22 '09 at 15:40
hmm, something must have changed serverside, that worked before, now example.com/wiki takes me to 192.168.1.x/cgi-bin/foswiki/home/csts/public_html/wiki. Looks like something changed on the server side that the $1 variable is getting passed wrong –  shaiss Sep 29 '09 at 0:53

Your Answer


