301 redirecting urls with special characters using web.config
301 redirecting urls with special characters using web.config - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the 301 redirecting urls with special characters using web.config error on your web browser. Problem :
Solution :
We hope that this article has helped you resolve the redirects, 301-redirect, windows error in your web browsers. Enjoy browsing the internet uninterrupted!
I am trying to redirect some old urls containing some special characters. When I place the url on the web.config automatically it gives me a 500 internal server error.
So, how do I translate the special character "&" to get it working.
The HTTP status code 500 "internal server error" is shown because the URL's you used are not properly escaped.
A quote from StackOverflow:
When adding a query string in the action of a rewrite rule, you've got to escape all the "?" and "&" characters in the URL.
? = ?
& = &
For example the following won't work:
<action type="Redirect" url="/long_url.aspx?key1=value1&key2=value2" />
For example the following will work:
<action type="Redirect" url="/long_url.aspx?key1=value1&key2=value2" />
Comments
Post a Comment