I got my web platform built on ruby on rails at https://example.com
My landing and about pages are hosted in a Wordpress in other host at https://examplecms.com.
What i would like to achieve is to make users to visit https://example.com get masked https://examplecms.com except when they are logged in as my platform's dashboard is routed in the root path /.
What i am trying to avoid is the user to see in the URL https://examplecms.com.
I've tried so far a couple of tricks:
I have been thinking into doing at proxy server level, using .htaccess or even using DNS strategies but i can't come up for a solution to these strategies to detect when the user is signed in or not?
Any ideas?
Thanks
Update: Stack:
You can use http://nginx.org/r/proxy_pass to silently redirect the user to a different page, without changing the URL that's shown to the user within the Location
field of the browser.
To check whether the user is logged in, you can install an error handler via http://nginx.org/r/error_page to redirect the user only if your normal page returns an error (e.g., if the normal proxy_pass
results in a 403 Forbidden
response, then redirect the user's request to the alternative proxy_pass
upstream as per the error handler).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With