Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Umbraco surface controller does not work

Tags:

routes

umbraco

I've got a site, and it works well on my local computer.

Then I upload it on a server and test it, but the surface controller I called with AJAX can not be routed, and returns 404 status.

My server is Windows Server 2016 Datacenter, and IIS version is 10.

My computer is Windows 10.....

Thanks ~

like image 939
zhang jacky Avatar asked Jul 29 '26 21:07

zhang jacky


1 Answers

I found the solution, and the answer is kind of bizzare. First of all, I tried:

  • renaming my controllers namespace from [UmbracoProjectname].Controllers to Controllers (as seen in SO another post)

  • making web.config identical in production as in local server where it works

  • updating umbracoReservedPaths with my controller path

  • lot of other stuff I forgot at the moment

The solution was this:

Instead of calling

https://domain.tld/umbraco/Surface/CustomSurface/test

I called it this way:

https://domain.tld//umbraco/Surface/CustomSurface/test

(Notice two slashes after domain)

So I guess it was some routing issue, I got it fixed this way. Hope it will help someone else.

like image 155
Dalibor Avatar answered Aug 03 '26 14:08

Dalibor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!