Suppose there is a website www.example.com with a web hosting account (Shared Hosting - Linux Server).
There is another website www.example2.com with a web hosting account (Shared Hosting - Linux Server) and having a sub-folder named example
I want to make configuration in such a way that when user opens http://www.example.com or http://example.com or https://www.example.com or https://example.com, the website lying under www.example2.com/example should get open but in the url bar, it should show example.com and its subpath. Visitor should get a feel that he is still on example.com, he should not know that the files of example.com are lying in example2.com/example
Codeigniter is mentioned here because the website present in example2.com/example is built using Codeigniter.
I have gone through various questions regarding URL masking on this forum and found the following solutions:
Using Iframe, but seems like it is not a perfect approach as it might hurt responsiveness and SEO, if not done with expertise.
Using Add on Domain, but add on domain facility is not available on my server, I can just create Domain Aliases
ProxyPass: I am not sure about it, never heard of it before and couldnot find a detailed implementation guidance.
mod_proxy with mod_redirect: Again, I am not sure about it, never heard of it before and couldnot find a detailed implementation guidance.
Someone said: You must then configure your home server to accept requests for this subdomain. (Probably through a ServerName or ServerAlias directive in a on your home (web) server.) Can this be done on my shared hosting server where I have limited access?
UPDATE I have tried the following:
RewriteBase "/" RewriteRule "^/(.*)$" "http://example2.com/example/$1" [P] ProxyPassReverse "/" "http://example2.com/example/"
I got the following:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
Where I am wrong.