New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
[NEED HELP] Url forwarding and masking with htaccess and ssl
Hi all!
I am trying to redirect domainA.com to domainB.com with masking (keep in URL bar the domainA.com/xxxxx while it is showing actually domainB.com/xxxxx) using https.
I have tried several rules in htaccess but all failed (either showind domainB in URL bar or getting errors like 500 in resolving the site).
I have used htaccess for doing that to several non-ssl sites in the past, but I cannot manage to do this work in https...
Any help with htaccess examples would be really appreciated...
Comments
that's probably bcos may be you do not have access to apache's main configuration file
I do have access, but how is this relevant? A htaccess rule does not have to break apache's configuration, will work as standalone
https://stackoverflow.com/questions/9106826/using-htaccess-to-mask-a-domain
may be im wrong though i tried editing htaccess after seeing your post got 500
Google's answer: https://webmasters.stackexchange.com/questions/67439/rewrite-url-with-masking-from-http-to-https-site-on-a-different-server-are-cer
The answer is wrong. htaccess can mask a domain. And I prefer to use htaccess because I am running the site behind a nginx proxy (redirect the url to an internal NAT ip of a virtual server). And, in any case, I want to use htaccess, not apache/nginx configs or http/iframe masking.
(Your's) Google's answer is about a non-https redirection to a specific url (xxx.php) and not masking a whole https web site. And of course, I have searched google for many many hours and could find a working solution. A 2 minutes search with a random result that don't even answer to my question, is not a contribution...
I just did a quick search and here's what I found:
https://stackoverflow.com/questions/12391661/redirect-but-not-show-the-url-redirec-htaccess
https://webmasters.stackexchange.com/questions/24057/htaccess-redirect-to-subfolder-in-different-domain-maintaining-old-domain-in-t
https://stackoverflow.com/questions/11621023/htaccess-redirect-domain-and-mask-url
I didn't really analyze them in detail but they seem to be answers to your question (or very similar).
HTH.
Your original post wrote redirect from a domain with a slash to another domain with a slash. It read like you want to re-direct from a specific non-https URL to a specific https URL. In any case, I won't be bothered with you next time because no point wasting time for people who can't even be a bit thankful that people are trying to help.
Not tried to offend you, and I am extremely thankful for people trying to help. But posting the first result from a google search that is even no relevant , is not really helping... Anyway, thanks for your effort to give an answer.
whatever you do, if you want to 'mask' it, that's either proxying or loading stuff in an iframe. of course you can proxy from htaccess f.i. with rewrite - it still won't be a redirect.
also don't misunderstand the possibility to mask internal paths with rewrite vs the use of different domains.
see the table at the end of this page: https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html
btw, if you get 500s you should be able to look up the error.log and see what it's complaining about ;-)
maybe it also would be helpful if you post in more detail what you tried, and what sort of setup you used for non-ssl that worked for you etc.