Well this is weird, we have a Sitecore 9.1
multisite, and when someone tries to access
https://www.abc.com/www.cc.com/ it is redirecting to 200
status code but with a server error message but if I remove www. -- .com
and keep only https://www.abc.com/cc/ it gives custom error page with page not found error message. I tried to find any solutions for this in blogs but could not find any. What could be the reason for this?
-
The request with /www.cc.com (without trailing slash) is handled at the IIS level and IIS considers it as a file in the file system and it returns the IIS error if not present. If you add trailing slash, Sitecore will return the error. What kind of server error are you seeing when you browse path with dots?– Nehemiah JeyakumarMar 10, 2022 at 19:58
-
There is a custom error HTML page which is shown to the user if user tries to access abc.com/www.cc.com and if he tries to browse only abc.com/cc , user is shown a 500 error page which is served from ErrorHandler code but this code never gets executed when I browse abc.com/www.cc.com– ashes321Mar 23, 2022 at 10:57
-
1Does this answer your question? How do you setup a 404 and 500 error page for missing files and media items? This is a very helpful post and discussion that explains why it happens and how to solve it.– Anna GevelMar 25, 2022 at 6:13
1 Answer
Please write a custom url handler, there you can handle the paramter you are receiving and redirect to 404 as and when required.
https://www.altudo.co/resources/blogs/how-to-create-sitecore-custom-urls-diy-guide
Best Regards, Sanjay
-
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.– Community BotMar 25, 2022 at 7:49