Forum Moderators: phranque
The thing is i want to display my helpdesk to my resellers on thier websites while offer the support.
Basically is it possible for mod rewrite to do the external rewriting?
for example:
when the user clicks on support.domain.com
it goes to domain2.com/support
is it possible? and how
The problem of passing a request to an external server is a different problem. If you have control of the subdomains like support.domain.com, then you can reverse-proxy these requests to domain2.com/support. If not, you will need those sites to link from <domain>.com to (perhaps) support.<domain>.domain2.com.
This is not as good at preserving 'branding' as what you want, but it may be the best you can achieve without having some control of your clients' servers.
Jim
A redirect sends a server response to the client saying, "Please re-request what you asked for using this new URL." If the client does issue a new request in response to that redirect, then it will show the new URL in its address bar. This is a browser function, and beyond your control.
So obviously, you don't want a redirect, you want a proxy through-put, where your server simply forwards the client request to another server "behind the scenes" and the client is unaware of this happening.
Setting up a reverse proxy is not a trivial task. For example, you will need to configure the front-end server to pass client request header information to the back-end server, and configure the back-end server to log this client header information in addition to or instead of the headers coming from the front-end server. Otherwise, the back-end server will log all requests as coming from the front-end server, and therefore its logs will contain no information about the original client requests. At a minimum, you will probably want the front-end server to send the client's REMOTE_ADDR to the back end using an X_FORWARDED_FOR header, so that the back-end server can log the proper IP address of the client.
Because this is a complex task, please understand that we cannot provide the level of support you may need to get it working; We have a limited number of all-volunteer contributors and staff here, most of whom have their own jobs to look after. So it'll be down to you to learn what you need to learn, or to hire the job out to a (preferably-local) contractor. We can handle very-specific questions here, but not "write my code"- or "configure my server(s)"- type requests.
See Apache mod_proxy and mod_rewrite for more information. Our Forum Charter [webmasterworld.com] may be quite helpful to you, both in learning how to get the most from this forum, and because it contains links to useful resources.
Jim
here is the code:
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /support [desk.domain1.com...]
ProxyPassReverse /support [desk.domain1.com...]
The idea is to get all of the "filepaths" in agreement on your support pages and in the proxy directives on the "customer" servers, and then take a few steps (e.g mod_rewrite) to 'steer' those filepaths to the proper location in your support server.
Remember, it is the browser that resolves relative links on your pages into the canonical URLs that it will request from your server(s), according to the domain and "directory" that it "sees" in its address bar. Look at the links on your proxied pages using view-page-source in the browser and examine the HTTP transactions between your server(s) and the browser using the Live HTTP Headers add-on for Firefox/Mozilla browsers. This may prove quite helpful in figuring all of this out.
Jim
I'm sorry I have to answer in generalities; You're dealing with a complex problem with many variables and dependencies, and solutions to these problems are "highly-customized," making specific answers impossible in a limited-information forum context.
Jim