Virtual Directories broken after upgrade to 4.40.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
I used to have two directories in the root of the website below the APP_Data folder which were custom to our website. One called images and the other called video. I'm not sure what is blocking this now or stopping these directories from being accessed. Any help is appreciated.

Here is an example of a broken video - https://www.gogofireworks.com/gogofireworks/video/Kiosk/Cowgirl-Up/

Here is an example of the broken image directory - https://www.gogofireworks.com/gogofireworks/images/buy_one_get_one_free_sticker_90x90.jpg
3 years ago
[email protected] wrote:
Here is an example of the broken image directory
https://www.gogofireworks.com/gogofireworks/images/buy_one_get_one_free_sticker_90x90.jpg

Typically you can put a directory in \nopCommerce\wwwroot
(Not the Website IIS root but in the root of the nopComemrce website)
Say it is \nopCommerce\wwwroot\gogofireworks
then you can add a subdirectory images
So In my case that would be C:\inetpub\wwwroot\nopCommerce\wwwroot\gogofireworks\images

Then you can download a file from the directory say http://yourwebsite.com/gogofireworks/images/buy_one_get_one_free_sticker_90x90.jpg

If you still have problems check the permission on the directory
3 years ago
OK I see what's happening now on my site. I moved all the videos into the wwwroot/videos folder but I have a bunch of folders and the index.htm is not loading. How can I tell nopcommerce to use index.htm as a default document or maybe something else is happening...

Normally our videos pull up by hard coded links to https://www.gogofireworks.com/gogofireworks/video/KIOSK/Above-the-Law/ - this is broken not sure why

but if you go to the index.htm file it works --- https://www.gogofireworks.com/gogofireworks/video/KIOSK/Above-the-Law/index.htm
3 years ago
Anyone have an idea why the site will let me navigate to the file in the directory index.htm but if I try to go to the directory level. Even though i have index.htm set as a default document, nopcommerce says page not found.

Is this some kind of url rewrite thing or some other protection?
3 years ago
This has broken the main functionality of our website. We have over 500 videos and have been running nopCommerce since 2010 or earlier. If anyone can add some input I would appreciate it.
3 years ago
It is the way .NetCore is configured - it thinks you are entering a route with the /directory/
Otherwise you need to explicitly call the url
As in https://demo.nopcommerce.com/errorpage.htm

Here is an old work around that discusses it - but I dont think this is available in .netcore 5 due to security issues
https://weblog.west-wind.com/posts/2013/aug/15/iis-default-documents-vs-aspnet-mvc-routes

See https://forums.asp.net/t/2051111.aspx?Is+there+a+workaround+for+routes+IgnoreRoute+in+ASP+NET+5+Method+not+implemented+yet+

Most likely you will need to customise your solution or make a pluign that will do the same job
To automatically return a html page you need a controller
This is how a contoller returns the error page above which is html
See src\Presentation\Nop.Web\Controllers\ErrorController.cs
3 years ago
Ah thanks for the info. That’s what I was afraid of. Was hoping there was a way to exclude that specific directory from this so it would load the default index.htm instead of returning the 404
3 years ago
If you're using IIS you should be able to setup a URL Rewrite rule to add "index.htm" for those subdirectories.

This may have an example you could adapt:
https://stackoverflow.com/questions/29439268/iis-rewrite-all-filename-to-filename-html
3 years ago
Thanks for that. Interesting idea.

Our folder structure is /kiosk/<product-name>/index.htm

Im not good with RegEx. Should be a way to do that also
3 years ago
Can the IIS URL rewrite rules be used with NopCommerce by editing the main web.config?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.