w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
htaccess - passing request uri as a parameter

You can use this rule:

RewriteCond %{HTTPS}s on(s)|
RewriteCond %{HTTP_HOST} ^(?:www.)?domainA.com$ [NC]
RewriteRule ^
http://domainB.com/?referer=http%1://%{HTTP_HOST}%{REQUEST_URI}
[L,NE,R=302]

This handles both http:// and https:// URLs.


EDIT: As per edited question you can use:

RewriteCond %{HTTPS}s on(s)|
RewriteCond %{HTTP_HOST} ^(?:www.)?domainA.com$ [NC]
RewriteRule !^listener.php$
/listener.php?actualRequest=http%1://%{HTTP_HOST}%{REQUEST_URI} [L,QSA]




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.