redirect the entire php url with params (apache/nginx) -


1) how make apache redirect whole url parameters, , make visible client, example: when client comes :

https://domain1.com/app/index.php?device_id=wewewe&ordna_ver=5.0&num=+1234567890 

it redirects him to:

https://domain2.com/app/index.php?device_id=wewewe&ordna_ver=5.0&num=+1234567890 

2) also, how make same redirect not visible client (he still see url domain1.com while opening domain2.com) ?

3) , third, how make same 2 things (redirects) nginx ?

thank help.

in nginx, visible client:

server_name domain1.com; return https://domain2.com$request_uri; 

in nginx, hiding redirect being visible client:

server_name domain1.com; location / {     proxy_pass https://domain2.com; } 

you might want use optional module http://nginx.org/docs/http/ngx_http_sub_module.html#sub_filter (requires recompilation of nginx), if want make sure replace mention of domain2.com proxied web-page domain1.com.

sub_filter "https://domain1.com" "https://domain2.com"; sub_filter_once off; 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -