Ticket

Bad Request - Invalid URL

Hi All,

I am getting the HTTP Error 400. The request url is invalid. Bad Request-Invalid URL like.

In my querystring value getting more than 300 count. That time i am getting this issue. Please refer the attachment.

Re: Bad Request - Invalid URL

Try to configure the max request length: https://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxquerystringlength(v=vs.110).aspx

It's questionable however that a slug that large is a good idea.

Thursday, September 29, 2016 6:58:00 AM bybleroy
  • bleroy
  • Lv. 08 Rookie
  • Total EXP: 527

Re: Bad Request - Invalid URL

Hi, Thanks. Actually where i have to mention this,

In Web.Config ?

[ConfigurationPropertyAttribute("maxQueryStringLength", DefaultValue = 2048)] [IntegerValidatorAttribute(MinValue = 0)] public int MaxQueryStringLength { get; set; }

Thursday, September 29, 2016 7:15:04 AM bynagamaths

Re: Bad Request - Invalid URL

In web.config, yes.

Thursday, September 29, 2016 6:32:32 PM bybleroy
  • bleroy
  • Lv. 08 Rookie
  • Total EXP: 527

Re: Bad Request - Invalid URL

Hi bleroy,

I have applied that changes to web.config, please refer the attached image. Still i am getting the same issue. Please help me to resolve this issue.

Friday, September 30, 2016 8:09:59 AM bynagamaths

Re: Bad Request - Invalid URL

That should work, I don't see anything that would get in the way, unless you modified another web.config than the one at the root of Orchard.Web.

Keep in mind though, that Internet Explorer won't handle query strings above 2k, so this will fail no matter what on IE, and that it's unwise to have such long URLs in the first place: they are unusable, unreadable, and make the request heavier for no good reason.

Your best fix is to have shorter URLs, which can be easily achieved by manually editing that slug in the Orchard admin for that content item.

Friday, September 30, 2016 7:11:21 PM bybleroy
  • bleroy
  • Lv. 08 Rookie
  • Total EXP: 527

Post a reply

You need to be signed in to post a reply.

Sign In