taz8020
asked on
web.congfig redirect with & symbol in it
Hi I am having trouble redirecting a few pages with & in it
eg <add key="/acatalog/car_&_vehic le_accesso ries.html" value="/ProductSection/Car _And_Vehic le_Accesso ries.aspx" />
the & symbol is causing me the error and ideas how to get arround it
eg <add key="/acatalog/car_&_vehic
the & symbol is causing me the error and ideas how to get arround it
ASKER
the problem is our old site used ampersand on about 20 urls and google have indexed them trying to redirect thrm to the new page that does not have them
But if you need the url this way you would have to escape the ampersand with & in the config.
http://xmmssc-www.star.le.ac.uk/SAS/xmmsas_20070308_1802/doc/param/node24.html
http://xmmssc-www.star.le.ac.uk/SAS/xmmsas_20070308_1802/doc/param/node24.html
like
<add key="/acatalog/car_&_v ehicle_acc essories.h tml" value="/ProductSection/Car _And_Vehic le_Accesso ries.aspx" />
<add key="/acatalog/car_&_v
ASKER
Hi Rainerj, thanks but i still get an error saying & is not allowed
Hi,
could you perhaps explain where and how you redirect (custom coded, ...)?
At least the last posted app key is valid in regards to general web.config rules.
Do you have a screenshot/detailed error message?
Thanks.
HTH
Rainer
could you perhaps explain where and how you redirect (custom coded, ...)?
At least the last posted app key is valid in regards to general web.config rules.
Do you have a screenshot/detailed error message?
Thanks.
HTH
Rainer
ASKER
A potentially dangerous Request.Path value was detected from the client (&).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (&).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (&).]
System.Web.HttpRequest.Val idateInput IfRequired ByConfig() +9023321
System.Web.PipelineStepMan ager.Valid ateHelper( HttpContex t context) +59
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (&).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (&).]
System.Web.HttpRequest.Val
System.Web.PipelineStepMan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the & (ampersand) is a reserved character and is not allowed as part of the path of an url. Ampersands are used to separate url parameters, so you will have to use another character like underscore or dash.