To display a product, I want to use this structure for the link:
/collections/:slug/:id
So far, I have created this folder structure:
collections/
_category/
_id.vue
_slug.vue
index.vue
_slug.vue and index.vue are in collections folder.
On local everything runs fine but when I make npm run dist and pushing to live, when trying to access:
/collections/_category or /collections/_category/_id
it gives not found.
What changes should I make to make it working?
One more thing to mention is the fact that when accessing a product from home page, everything is working fine and the product is displayed but when I am trying to refresh that page, I am getting 404 notfound, ngnix. Could it be an ngnix problem? Nginx config:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/{link_to_the_project}/dist;
server_name {mydomainname}.ro;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
}
location ~ /.ht {
deny all;
}
}
question from:https://stackoverflow.com/questions/65833437/nuxt-routing-failing-to-create-sub-route-on-build