Forum Moderators: phranque
http://www.example.com -> http://127.0.34.456/dir/dir/dir
But it should still display in the address bar: http://www.example.com
Anybody have any ideas on how to implement this in a .htaccess?
[edited by: jdMorgan at 2:34 am (utc) on May 9, 2005]
[edit reason] Examplified. [/edit]
This is how you do it, to forward to unregistered DNS servers such as home networks and keep the same domain in the address bar. This uses the proxy method.
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^\www.example.com(.*) http://127.0.45.456/dir/dir/dir$1 [P]
After the redirect is made, www.example.com should still be in the addressbar :).
Where do I put the HTTP_REFERER in this to have the visitor's IP appended to the HTTP header on the redirect instead of the current domain's IP address? :
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^\example.com(.*) http://127.0.45.456/dir/dir/dir$1 [P]
RewriteRule ^example\.com/(.*) http://127.0.45.456/dir/dir/dir/$1?[b]ref[/b]=%{HTTP_REFERER} [QSA,P]
RewriteRule %{QUERY_STRING} [b]ref[/b]=([^&]+)
RewriteRule .* - [E=[i]fe_ref[/i]:%1,L]
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{[i]fe_ref[/i]}e\" \"%{User-agent}i\""
Jim