Routes - What am I doing wrong here

Hi fellow Wapplers,

I’ve made a site with routes before. But right now, I’m doing something wrong and I can’t figure it out. Hopefully I’m missing something simple.

It looks like everything pops up correctly on my homepage, but the content of a route page just isn’t pulling up.

The main page is /layouts/mainpages/home.php.
The first route I’d like to load is on …/…/_home.html on my site. (THIS IS THE CONTENT THAT ISN’T PULLING UP)

These lines are in the home.php file:

 <base href="/layouts/mainpages/">
 <script src="../../dmxAppConnect/dmxAppConnect.js"></script>

At the end of home.php I have this line:

<div is="dmx-route" path="/home" url="../../_home.html" id="id_MainpageNormalStuffRoute"></div>

Here is my routes section:

Here is the route being loaded on my page:
wappler-ap-5-01

For awhile I thought maybe …/…/_home.html just needed to have the “show” enabled, so I tried this on the route section of home.php:
wappler-ap-5-03

And I think I have the routes setup correctly.

Any thoughts are appreciated.
Thanks,
Jeff

Bump

Try Exact first
image

If that does not work, try giving one of the files a different name that does not look like home

Still can’t get it.
But, thank you, Ben!

I made a page called button test.

If I go to my website /home/ it works.
If I go to /home/buttontest/ the website loads (the home page header loads) but the content from button test does not load.

image
image

Looking at the way your route is set up you should be just going to /buttontest/ without the home part.

It would seem that way. But if I go to /buttontest/ without the home part I get this:

image

The .htaccess page makes it clearer, i think, that it’s looking for /home/buttontest/

## Wappler routing
RewriteEngine On
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?TestingPage(?:/)?$ TestingPage.php [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?home(?:/)?$ layouts/mainpages/Home.php [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?home/TestingPage(?:/)?$ layouts/mainpages/Home.php [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?home/main/(?:/)?$ layouts/mainpages/Home.php [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?home/buttontest/(?:/)?$ layouts/mainpages/Home.php [QSA,NC,L]
## End Wappler routing

Are you sure your pages and htaccess are uploaded to your server?
I cannot access yoursite.com/layouts/mainpages/Home.php when i try in my browser … i am being redirected to the index.php page

It works if you’re logged in.

But, literally, just before you posted that I noticed that the routes.json file was here locally, but missing on the remote server.
So, I did a full publish of the site and it all seems to work now.

/smh I thought I was doing it right. :slight_smile: I guess I should double check for the routes.json file next time!

routes.js is only needed locally for the routing panel to be able to generate the htaccess rules and show your routes. Probably the htaccess r any of your files was missing from the server.

Ah, makes sense. Because I tried to upload the routes.json manually and nothing changed. But when I did the full publish it worked.