I have implemented the 301 permanent redirect as read in this article,
Everything is working except in one case the redirect happens to
www.sitename.com/www.sitename.com.
It seems like the place where i am trying to redirect is getting appended to the sitename.I want that to happen that when i am trying to redirect to controller action but not when i am redirecting to the site home.
For eg when i do this ,redirect occurs to the
newUrl = "Blog/TagPosts/" + {tag}
response.RedirectLocation = newUrl;
response.End();
www.sitename.com/blog/tagposts.This is what i need but when i redirect to
www.sitename.com doing this
response.Redirect(www.sitename.com);
response.End();
the url gets redirected to www.sitename.com/www.sitename.com,How can this be avoided?
The Response.Redirectlocation is absolute URI that is transmitted to the client in the HTTP Location header. Try redirecting with the fully qualified location http:// http://www.sitename.com.