mod_rewrite solution needed

Hi folks,

I've been trying to google numerous resources to find a way to do this and am hoping it's possible.
What I would like to achieve is the following;

http://www.domain1.com/forms/contact.php
rewritten to be
http://www.domain2.com/contact.php

The reason for this is because I offered to host the contact page for someone's site since they don't have PHP capabilities and my mailer script is 100% PHP.
So, I would like for their visitors to be using my script on my hosted domain, but it would appear as though they never left the original website to use the form.

If this can be done, can someone provide me a rewrite rule that would accomplish this?

Thanks everyone.

~A~
LVL 12
Richard DavisSenior Web DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David S.Commented:
No, something like that would be a major security violation. mod_rewrite can only rewrite URLs that point to the same web server.

While I discourage the use of framesets (except when used in web-apps), they could be used to do this.

It's really a shame that some web servers don't have PHP installed.
0
Richard DavisSenior Web DeveloperAuthor Commented:
Thank you very much for your feedback, Kravimir!

So, my best option is a framset or just allow the redirect and send the visitor back to the original website to a thank you page upon completion of the form submission then?

~A~
0
David S.Commented:
Your reply reminded me of a possible alternative that may be an even better solution.

http://www.domain2.com/contact.html has a form whose action is http://www.domain1.com/forms/contact.php if there are no errors then contact.php redirects to http://www.domain2.com/thanks.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Richard DavisSenior Web DeveloperAuthor Commented:
That sounds like the perfect solution. Then, atleast the visitor only hits the non-original domain just long enough for processing and then returns back rather seamlessly.

I think I like that alternative to the impossible one. Hehehe.

Thanks a million, Kravimir! :)

~A~
0
Richard DavisSenior Web DeveloperAuthor Commented:
In lieu of a possible brick wall, the solution provided is a nice hack/workaround that will suffice my immediate needs. Perhaps I'll research writing a web service that the non-PHP server could hit via an Ajax call.

Thanks!
0
David S.Commented:
You're very welcome. I'm glad I could help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.