Sitecore SXA error illegal characters in path - sitecore8.2

Any one have solution for this issue .
With Sitecore Solution without SXA Adding empty attribute to httpRunTime tag in web.config file >> requestPathInvalidCharacters="", can fix issue special characters in URL and redirect you to "not found page" insted of 400 error page with message "A potentially dangerous Request.Path value was detected from the client()"
URL like : http://abc/* or http://abc/& >> redirect to item not found page and I replaced it with custom error page . So, NO issue with sitecore site without SXA.
I tried same solution with [sitecore SXA] site but not effected, It go to another error page with message >> illegal characters in path, Also I applied this solution https://kb.sitecore.net/articles/059908, But nothing effect, I still have the same error!!
Any solution, I looking for same behavior in SXA site

I fixed it by using URl rewrite in IIS and created redirect rule to 404 page hosted in site core

Related

404 error when URL contains a '+' for a parameter with ASP.Net Core

My server is returning a 404 error when a parameter has a space encoded as a + instead of %20. I don't understand why.
The route is of the form
[Route("/Search/PRM1/{prm1}/PRM2/{prm2}/PRM3/{prm3}")
My 1st question would be how to ask the server to understand this kind of URL?
https://example.com/Search/PRM1/prm1%20value/PRM2/prm2+value/PRM3/prm3%20value
My 2nd question would be how to automatically generate urls with + instead of %20, which are easier to read? Is there a difference regarding SEO?
URLs are generated on server side in cshtml:
link
with prmX variables "clear" text (including spaces). The + URL has been generated when using #System.Net.WebUtility.UrlEncode(prm2) instead of #prm2
I have checked the link below, but the solution does not seem to work with ASP.Net Core:
WebAPI route 404's when there is a trailing space in the URL
If you're provding a searching service or a field that might involve special characters or . , + , / , \ it is always better to send it as a Query String
[Route("/Search/PRM1/{prm1}/PRM2/{prm2}/PRM3?prm3=your value here")

W3C validator says 'feed does not validate' 'url must be a full URL'... whats wrong with it?

Validating my feed, it has an enclosure with a URL of
https://archive.org/download/NigelFarageAPersonalMessageToNorthernIrelandVoters./Nigel%20Farage,%20a%20personal%20message%20to%20Northern%20Ireland%20voters..mp3
I know it is a bit convoluted... but what is wrong with it? The stop in the directory name? the double dot in the file name? the comma? all of em?
I have looked at the RFC on URL's but cant make it out(!).
This feed does not validate.
line 441, column 2: url must be a full URL: https://archive.org/download/NigelFarageAPersonalMessageToNorthernIrelandVoters./Nigel%20Farage,%20a%20personal%20message%20to%20Northern%20Ireland%20voters..mp3 (4 occurrences) [help]
<enclosure type="audio/mpeg" url="https://archive.org/download/NigelFarage ...
^
** edit **
A useful (even if incorrect) answer was added (and removed...) showing the result from the w3c URL validator - https://validator.w3.org/checklink
This Link Checker looks for issues in links, anchors and referenced objects in a Web page, CSS style sheet, or recursively on a whole Web site. For best results, it is recommended to first ensure that the documents checked use Valid (X)HTML Markup and CSS. The Link Checker is part of the W3C's validators and Quality Web tools.
If you find this question, you may find the link checker a useful resource!
The problem seems to be that it’s a HTTPS URL instead of a HTTP URL.
The linked error documentation, foo attribute of bar must be a full URL, says:
If this is a link to a web page, you must include the "http://" at the beginning and immediately follow it with a valid domain name.
The RSS 2.0 spec says about <enclosure>:
The url must be an http url.
If you change https://archive.org/download/… to http://archive.org/download/…, it validates.
And if you don't have httpS then your SSL says your page isn't secure. #feedvalidator step up. There are a ton of feedback/complaints about this on the support forum here https://groups.google.com/forum/#!forum/feedvalidator-users
More specifically here: https://github.com/rubys/feedvalidator/issues/16

Tapestry "/" in parameters bug

If I add slash / to the parameter of a page, even in encoded form %2F I get an error.
Sample URL:
http://mywebsite.com/somepage?param=dfgdfg%2F
Error:
Input string 'dfgdfg/' is not valid; the character '/' at position 7 is not valid.
I am trying to pass whole URL as parameter (to later redirect user to that URL) so there are a lot of slashes in there.
Is this a bug? Is there any workaround?
I could theoretically replace all slashes with something else than %2F but that is something I would attempt after everything else fails...
As I've learned this happens on Jetty only, which I use for development...
This custom service override solved the problem:
http://tapestry.1045711.n5.nabble.com/Customising-T5-URL-Encoding-tp2412550p2412551.html
Looks very hacky but works :).
See the Web Services More example on the JumpStart page. Works for me on Jetty.
The JumpStart page has many "how-to-do-this-in-Tapestry" examples.

ASP.NET MVC - Illegal characters in path - redirect from Application_Error

In my application I generated few url which contained " (double quotes), unfortunately.
I corrected the url's but google bot already indexed wrong urls.
Now I get quite often following exception:
System.ArgumentException: Illegal characters in path.
The only one place I can catch the error is the Application_Error in the Global.asax - I clean up the url over there and try to redirect to correct url - unfortunately it is not working... The application is not redirecting and I don't know why... Any suggestions?

Symfony: Weird routing issue

I've got following URL in symfony (specifics not important):
/frontend_dev.php/something/25/apple
... and a routing rule:
/something/:id/:word
The URL works fine when clicked through to on the site, but not when I type in the URL. Instead, symfony says:
Unable to find a matching route to generate url for params "NULL".
The weird thing is that I can navigate to this page and it works, but when hitting Enter in the browser address bar, it no longer finds it.
Any thoughts on what might be the cause of something like this generally?
I should also add that the URL was working fine when typed in the address bar earlier, but doesn't anymore, and I'm not sure what's there that might be interfering with it.
Thanks in advance.
UPDATE:
The exact routing rule:
profile:
url: /profile/:id/:un
param: {module: profile, action: profile}
UPDATE:
Debug toolbar log (the higlighted part):
Unable to find a matching route to generate url for params "NULL". Toggle debug stack
#4 » in sfException::outputStackTrace() from SF_ROOT_DIR\lib\vendor\symfony\lib\exception\sfException.class.php line 110
#3 » in sfException->printStackTrace() from SF_ROOT_DIR\lib\vendor\symfony\lib\controller\sfFrontWebController.class.php line 52
#2 » in sfFrontWebController->dispatch() from SF_ROOT_DIR\lib\vendor\symfony\lib\util\sfContext.class.php line 170
#1 » in sfContext->dispatch() from SF_ROOT_DIR\web\frontend_dev.php line 13
RESOLVED:
Found it....
I had this in my code on the failing page:
<?php echo link_to(__('Back to previous page').' ›', $sf_request->getReferer()) ?>
The referer fails when typing address into bar.
Unless you're neglecting to mention that you navigate to this page usually from forms and it's the lack of POST data that is upsetting the routing; which I'm thinking this is not- this surely must be an issue with your browser.
Have you tried this in a different browser on your system?
If you're still having issues can you copy in the relevant section of your routing.yml?
I was getting this error message on a live site and found the issue to be a link_to command which was being dynamically populated by a field from the database.
However the field was null, so the link_to received no link info.

Resources