4

Need the following please:

 http://subdomain.test.co.uk/newsite  --> redirect to apache port 80
 http://subdomain.test.co.uk  -->   redirect to iis on port 8080

Have changed IIS to run on 8080 and both sites run fine using localhost.

Have also enabled the following in httpd.conf

LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_proxy.so

Then added following to httpd-vhosts.conf

<VirtualHost *:80>
ServerName subdomain.test.co.uk
ServerAlias *
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
</VirtualHost>

but no content is loaded when goto domain - please advise TQ

zima10101
  • 307
  • 1
  • 4
  • 16
  • What does it mean for content to not load? Surely you get some HTTP error and some log entry. – covener Apr 29 '17 at 00:27
  • The goal and the terminology are a bit suspicious. If you want to redirect the `Redirect` tag might be useful, but you seem to use the proxy modul... And probably it would worth checking the apache access/error logs. – Lajos Veres Apr 30 '17 at 14:22

3 Answers3

0

Sounds like you need to be able to redirect from both. If in "root" folder, and in appache, then redirect to iis (port 8080). If in subfolder and in iis, then redirect to appache (port 80).

So, in IIS, you can create the subfolder and set it as an application. Then within it, go to HTTP Redirect. And that should work for that side of things. (I usually do this by having a HTTP site that redirects to a HTTPS site, to thereby force HTTPS.) Just include the port number in your case. And you should be started on the right path.

But honestly, I'd set these up differently. I'd use the subdomain to the purpose that you want to do with folders. I'd have newsite.test.co.uk; if its an option, as that would make me more comfortable.

Or, if you keep going in your direction, then I'd set IIS to port 80, and Appache to port 8080, putting the base site at the default port, and the new site at the new port.

Related:

How to set up subdomains on IIS 7

How to redirect a site to another location in IIS7

Apache redirect

https://www.digitalocean.com/community/tutorials/how-to-create-temporary-and-permanent-redirects-with-apache-and-nginx

Community
  • 1
  • 1
Greg
  • 2,410
  • 21
  • 26
0

If you are running a vm you could add another network card and give them seperate IP's ,then in your router you confige each port to go to a different IP

-1

You also need to have an entry in hosts file which would be located C:\Windows\System32\drivers\etc. Open this file in notepad or any other text editor and another entry like the below at the last line of your file and then try again.

127.0.0.1       subdomain.test.co.uk
Rajesh
  • 934
  • 12
  • 23