Routing Issues

I created a new target, uploaded it to the location but when trying to run the application none of the links work. I have refreshed the routes many times, changed from Site Root to Document many times, and still no resolution. I think something got corrupted. Any advice as to what I am doing wrong or what needs fixing. Thanks much. Please see the video. Please video showing the solution working on my local but not on my remote host.

Any assistance on this if possible?

Did you try a full site publish so your .htaccess file gets updated on the live server?

Yep. Did that as well.

So I got it to work on my hosting by using " ./route-name/ " instead of " /route-name/ ". However, if I refresh the page I get the same error “The requested URL /route-name was not found on this server.”

  1. Any reason why I must use the dot?
  2. How do I get it to reload the page on refresh?

what routing options have you chosen in your project settings?

Hi George thanks for the quick response. The screenshot shows the options

Screenshot 2021-03-08 at 8.38.23 AM

and how are your routes defined in the routing manager?

and what do you have in your .htaccess ?

.htaccess.zip (1.1 KB)

So which routes doesn’t work? and what exactly? Seems all good to me

Unfortunately all the routes aren’t working. Oh it is important to note I am pulling the routes dynamically.

<ul class="sidebar-submenu" is="dmx-repeat" id="sub_rpt" dmx-bind:repeat="links">
<li><a dmx-bind:href="'.'+links_link"><i class="zmdi zmdi-dot-circle-alt"></i> {{display}}</a></li>
</ul>

From the code, I must use .’+links_link’ with the dot in front for the route to work.

So on 1 server it works and on the other it doesn’t. Since you get a 404 when accessing the url it seems that the rewrites are not working on that server. That means that the .htaccess was not uploaded to that server or that the server doesn’t support .htaccess. Are both servers running Apache? It can be that the second server is running nginx or IIS, nginx is not supported by Wappler and for IIS you need a web.config. Just make sure all targets use the same type of server for compatibility.

Hi Patrick,
Thanks for the info. However, the routes work once I place a DOT in front of the actual route. Example,

CORRECT LINK - /route-link/
MODIFIED LINK - ./route-link/

In addition, I have another solution on the same server in a subdirectory that works fine. Any other suggestions you think I should look at.

The ./route-link/ are for the page routes, with that it modifies the url without reloading the page. When you have /route-link/ it will do a normal navigation and reload the page, the .htaccess rewrite should then make sure it knows which page it should load.

1 Like

I didn’t know this. Valuable information.

Isn’t it the other way around? I usually use the DOT for those links I require a page refresh

Resolved. Modified the httpd.conf with the following

   <Directory>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
  </Directory>

So in essence .htaccess was enabled by default but the directory was limited. Had to allow overrides and SymLinks. So if you are using DigitalOcean or GoDaddy this is your solution

Hi all, I’m having the same issue here and I’m running an IIS Windows server. Does anyone have a copy of a web.config file I can use to resolve the non-working routing issues please…?