Hey,

I have a project that requires me to use two different servers. It's a website, half is written in PHP and the other in ASP.NET both on separate servers. The problem is the ASP.NET address in an IP like . Is there anyway to change this in C# or IIS so it looks like the original address?

Dani AI

Generated

— the cleanest, most reliable way to make the ASP.NET portion appear under your main site (instead of showing the numeric IP) is to put a proxy in front of the two servers or to host the ASP.NET site with a hostname that matches your domain. was right to point toward rewriting/proxying, and ’s IIS hint is on the right track; ’s mapping note points to the DNS-based option you can use if you control the target server’s bindings.

Using IIS as a reverse proxy (Application Request Routing + URL Rewrite) is the usual production solution. Put the proxy on the server that owns your public domain, create a rule that forwards requests for the path (for example, /website/*) to the ASP.NET server, and enable the option to rewrite host headers in responses so links and redirects come back using your domain. This preserves the original URL in the browser, lets you present a single certificate, and avoids cross-domain issues. Microsoft’s guidance for this is here: Reverse proxy with URL Rewrite v2 and Application Request Routing.

If you cannot run a proxy, mapping a subdomain (CNAME/A record) to the ASP.NET server and configuring that server to accept the host header is simpler but requires the ASP.NET host to have the correct binding and certificate. A plain HTTP redirect will expose the other host in the browser and is usually not desirable.

Quick troubleshooting checklist:

  • Ensure SSL is terminated where you expect (proxy vs backend) and install the correct cert.
  • Turn on reverse-rewrite or add outbound rules if links point to the IP.
  • Watch for absolute URLs and cookie domains from the backend; convert to relative or rewrite as needed.
  • Test headers with curl or browser dev tools to confirm Host/X-Forwarded-* values.

Use the ARR+URL Rewrite docs above for step details and examples when you implement the proxy.

Recommended Answers

All 3 Replies

URL re-writing...!

google around..you'll get the idea..

--Click Sites in the Google Apps control panel.
--On the Sites Settings page, select the Web address mapping tab.
--Click Add a new web address.
--Enter the location of the site you want to map ('yoursite' in the example above).
--In the 'Web Address' field, enter the sub-domain you'd like to map it to (www in the example above).
--Select Add mapping and follow the instructions provided. -Depending on your domain registrar, you may need to make CNAME changes. You'll see instructions for making CNAME changes after you select Add mapping.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.