Setting runAllManagedModulesForAllRequests="true" in web.config stops loading images

Kenny Deblaere asked on February 9, 2017 14:40

Hello

When configuring my robot.txt, I see I should add runAllManagedModulesForAllRequests="true" to my web.config. When doing that, the problem is, I can't see any of my images anymore, they are not found.

I can direct to my robot.txt-file, but not to my images.

Is there a way to get the both ways?

Kind regards

Kenny

Recent Answers


Brenden Kehren answered on February 9, 2017 15:14

I'm not sure that you specifically need to add runAllManagedModulesForAllRequests="true" to make a robots.txt file to work. More importantly, are you placing this in the file system or in the content tree? There should be no reason to put it in the file system, place it in the content tree.

Secondly, when you view the source of the images, what is incorrect about the URL of the images? Is there a missing extension or an extra / or a ~ in front of the image URL. If so then there are a few things you may need to configure like extensions and how relative URLs are processed.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on February 9, 2017 15:15

Hi,
What are the IIS settings? Are you using the Integrated pipeline mode instead of Classic?
Also, what are the URLs and SEO settings when it comes to "Files friendly URL extension"? Only one extension is allowed, to support all leave the setting empty.

What is the generated URL of the broken images?

0 votesVote for this answer Mark as a Correct answer

Kenny Deblaere answered on February 9, 2017 15:28

Hi Brenden, Juraj

My robots.txt file is in the content tree. When surfing to http://mydomain.com/robots, I'm getting the item, but when surfing to http://mydomain.com/robots.txt, the following error comes: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable..

My images are loaded by http://mydomain.com/media/image.jpg, in my explorer, there is <img src="/media/img.jpg" />.

I'm not using IIS, but an Azure Web App. There isn't an option on the friendly url path.

Kind regards

Kenny

0 votesVote for this answer Mark as a Correct answer

Peter M answered on February 9, 2017 16:23 (last edited on February 9, 2017 16:24)

I see from where this all is growing.

robots.txt has nothing to do with runAllManagedModulesForAllRequests. if you set runAllManagedModulesForAllRequests - it will run all your requests (such images, css, javascript files) through asp.net pipeline.

Do you have multiple sites running and you want to serve different robots.txt for each of the sites?

if not: "The most direct way to use robots.txt in Kentico is to physically add the text file into the root of your web project."

0 votesVote for this answer Mark as a Correct answer

Kenny Deblaere answered on February 9, 2017 16:34

Hi Peter

I'm having multiple domain aliases, and some aliases should be allowed for the robots.txt file. Every domain alias has an own sitemap: located ad: http://mydomain.com/sitemap, http://mydomain1.com/sitemap, which is fixed with a macro.

So to answer your question, I think it's neccessary to have my robots.txt-file into the content tree?

Kind regards

Kenny

0 votesVote for this answer Mark as a Correct answer

Peter M answered on February 9, 2017 17:49

I have configured my multiple robot.txt in the following way:

  1. Delete physical file one in the kentico root
  2. Create a page with fixed route like below (might need to restart the app to get the rout working) Image Text

  3. On this page add "custom response" web part for each domain:

Image Text

0 votesVote for this answer Mark as a Correct answer

Ilesh Mistry answered on February 9, 2017 17:49 (last edited on February 9, 2017 17:52)

Hi Kenny What is the broken urls and how are the images added? Thanks Ilesh

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.