IIS Redirects me to another URL

61 Views Asked by At

I have a website on my local computer. It is a CMS(DNN) Website which is for long time on my computer. it is on 127.0.0.1:80 but I set an address for it in the host file. It was working well till today that when I tried to visit it, I was redirected to another address which I had set on the host file too. I deleted that address from the host file and restarted my computer but I still redirected to that address.

2

There are 2 best solutions below

0
On

Hosts file entries are cached by the browser and there is no need to restart the pc (just the browser).

It seems you may need to revisit your configuration in IIS: If you are using two sites withe same IP and port number, you will need to use a different host header for each. Check the following link for more info: http://forums.iis.net/t/1210669.aspx?Multiple+web+sites+in+IIS+8+5

example, if you set host headers for the sites as site1 and site2. Then add the following hosts file entry:

127.0.0.1 site1 site2

Then restart your browser and if you navigate to http://site1 and it will load the correct site. Same for http://site2 of course

1
On

You should check the PortalAlias table in DNN. It is likely that the wrong Alias is listed in there, you can remove that from the database, then restart the APP in IIS (or modify the web.config to do this) and then try to access the original URL.

select * from portalalias


delete portalalias where httpalias = 'http://yourbadurl/'