Can someone see what I’m doing wrong here. I Would expect it to redirect me to http:\www.google.com but instead I end up in a loop.
public ActionResult Index()
{
var redirecturl = string.Format("http:\\www.google.com");
return RedirectPermanent(redirecturl);
}
Just if you need it, here is my Routes.
routes.MapRoute(
"Default", // Route name
"{*url}", // URL with parameters
new { controller = "Redirect", action = "Index"} // Parameter defaults
);
I end up with an url like this http://localhost:20000/google.com and an error Error 310 (net::ERR_TOO_MANY_REDIRECTS):
This is a small example I created, I want to end up with a small mvc site, that responce to all url, create a log entry and then do a permanent redirect to another domain (301).
Try redirect to http://www.google.com not http:\www.google.com
as you can see the first is a link while the second isn’t