Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.

 

Redirects in IIS

Vote:
 

Hi,

Im having an issue with using the built in HTTP Redirects in IIS and my Episerver 7.5 site. I have multiple sites configured like this;

www.mysite.fi -> goes to root folder www-fi


www.mysite.ee -> goes to root folder www-ee


The different sites have different languagebranches, such as;

www.mysite.fi/fi
www.mysite.fi/sv

www.mysite.ee/et
www.mysite.ee/ru

I would like to configure so that when the user tries to access www.mysite.fi it gets redirected to www.mysite.fi/fi and the same goes for www.mysite.ee, the user gets redirected to www.mysite.ee/et when trying to access this site. When I use this configuration;

https://i.imgur.com/oVDZxd2.jpg

I do indeed get redirected, but I get presented with an error saying something like "this site contains multiple redirects and the request is unable to continue". 

Do I need to override episerver-redirects in order to solve this? Do i need to modify my config-files?

Thanks!

#90169
Sep 03, 2014 11:53
Vote:
 

"this site contains multiple redirects and the request is unable to continue" means that there is a loop, it redirects to it self

Read more here on how to solve this:


http://stackoverflow.com/questions/7018818/iis7-url-redirection-from-root-to-sub-directory

#90189
Sep 03, 2014 13:03
Vote:
 
You may try to select "Only redirect requests to content in this directory (not subdirectories)" in IIS
#90194
Sep 03, 2014 13:29
Vote:
 

Is there a best practice for handling episerver sites on a top domain level? 

My solution was creating a webroot-folder for each site, ala's:

www-fi

www-et

and pointing each site to it's corresponding catalogue. I also had to add the following to the web.config file;





That very much redirects me to the appropriate language when trying to access www.mysite.fi, but i doubt this is the correct way of doing it. 

Thanks for your replies, Henrik's link pointed me in the right direction.

Ahmet: As you can see in my screenshot, I did exactly that without any good result :/

#90199
Sep 03, 2014 13:51
Vote:
 

Great to know Robin.

Please mark it as answer if you think it helped you

#90204
Sep 03, 2014 15:10
Vote:
 

Do you have multiple sites or multiple language branches mapped to different domains within single site?

#90211
Edited, Sep 03, 2014 19:29
Vote:
 

Robin I wouldn't create two different directories for the two top domains. Instead I would create two bindings in IIS for the two top domains and have them go to the same web root.

Then I would have some redirect rules to correct a user going to www.mysite.fi/et to www.mysite.ee/et.

/T

#90212
Sep 03, 2014 19:31
Vote:
 

Valdis: Yes, we have multiple language branches mapped to different domains within a single site. www.mysite.fi/fi and www.mysite.se/fi for example. If thats what you mean..?


Toni: That sounds like a better plan, how would I implement these redirect rules though? Via a RedirectProvider?

#90224
Sep 04, 2014 8:47
Vote:
 

Robin, if you have multiple language branches in single site why not just use host binding and strictLanguageRouting? Johan can enlight you more:

http://world.episerver.com/Blogs/Johan-Bjornfot/Dates1/2014/9/Changes-in-simple-address-routing/

#90393
Sep 08, 2014 23:39
Vote:
 

Valdis nailed it, strictLanguageRouting was exactly what I needed. Thanks everyone! 

#90400
Sep 09, 2014 7:43
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.