[Solved] Getting full url in mod_redirect
Added by AlxT over 8 years ago
I need to redirect to my script with a special parameters, i.e.:
my hotspot-site is mysite.local
so while getting to any site i.e. http://lighttpd.net/wiki/index.php, client is redirecting to mysite.local but it should be redirected with a special parameter:
mysite.local/my.fcgi?from=http://lighttpd.net/wiki/index.php so I need full url with protocol "http://lighttpd.net/wiki/index.php".
by using mod_redirect I could get only lighttpd.net/wiki/index.php via %0$0, is it possible to get full url with protocol, may be there is some special variable?
config:
$HTTP["host"] =~ "(.*)" { url.redirect = ( "(.*)" => "http://mysite.local/my.fcgi?from=%0$0" url.redirect-code = 302
y lighttpd version is 1.4.39, my OS is CentOS 6.4 x86_64 , browser firefox 45.1.0
Replies (2)
RE: Getting full url in mod_redirect - Added by gstrauss over 8 years ago
You can use mod_magnet with a short lua script (written by you) to manipulate the URL in ways more powerful than mod_rewrite currently provides.