By some coincidence this problem has come up twice in the last week.
A customer has an existing PHP web site which they want to keep. They also have or will soon have some ASP.net web pages that they wish to integrate into the existing site, in a way that it appears as a single site.
We have though of the following possibilities:
Has anyone tried any of these? Has a better suggestion? Is there any we should definatly avoid?
Thanks
Shiraz
It really depends on what an acceptable level of integration is. Your original suggestions have a number of issues with maintainability, and I would not suggest they are used for an public-facing internet site.
If I had full control, I might consider migrating the PHP site to IIS, and deploying ASP.NET pages to the site alongside the PHP files. This can be quite tricky depending on how the PHP site has been built. Problems you might run into including:
On your suggested options
All these options are completely overboard!
Simple solution would be to keep the solutions hosted seperately, Apache & IIS respectively. And handle the integration Via Routing. The authentication could be handled by using the "Cookie"
We've handled this recently for a customer with no issues
The web front end was based on wordpress & mySQL and an entire reporting module was MVC 3/4 based on SQL server 2008 r2 based.
We just used sub domains .ie www.somecompany.com for website and reports.somecompany.com for the reports.
We then just wrote a simple wordpress extension, to store linking data to which contained relevant information to create reports. ie Guid ID of user and report type etc.
Which essentially just presented the User with a page containing some reports options they could run - hyperlinks <a href="http://reports.somecompanyurl.com/bill/{some guid}>You Monthly Bill</a>
ie Monthly Bill
Both sites shared a common theme, which does carry some maintenance burden, but no more than a usual web project. ie.. MVC and PHP theme files do have some differences, but in general the CSS files were the same.
I think we did customize the cookie a bit, but this wasn't really any hardship, as both solutions just used the same cookie name and cookie encryption.
On the whole it was a fairly painless integration project, as most communication was handled via routing.
we've been running this for 6 months without any issues.
Can the entire site be hosted on a windows machine running IIS? Because IIS can serve PHP pages as well as asp.net. That way you can mix-and-match the pages together, seamlessly.
Another, more "dirty" option would be to use PHP to "read" the HTML output from the remote asp.net pages directly. You would have one PHP file for each corresponding asp.net page and then you could "read" it via HTTP using PHP's file_get_contents
method:
$content = file_get_contents('http://www.example.com/remotepage.aspx');
You'd probably want to cache the results locally to improve efficiency.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.