How to use app router to use .html in the end for all the pages?
Unanswered
Cuvier’s Dwarf Caiman posted this in #help-forum
Cuvier’s Dwarf CaimanOP
for example-
1. parent.html
2. parent/child.html
3. parent/child/sub-child.html and so on
1. parent.html
2. parent/child.html
3. parent/child/sub-child.html and so on
15 Replies
as unless trailing slash is enabled, it should do that
otherwise, i don't think you can do this for general server (without custom weidness like every route end with it)
@Cuvier’s Dwarf Caiman for example-
1. parent.html
2. parent/child.html
3. parent/child/sub-child.html and so on
Unless its static export u cant.
@Cuvier’s Dwarf Caiman for example-
1. parent.html
2. parent/child.html
3. parent/child/sub-child.html and so on
Rewrite requests ending with .html to corresponding pages without the .html
@risky Is this for static export?
Cuvier’s Dwarf CaimanOP
It's not static export.
@joulev Rewrite requests ending with .html to corresponding pages without the .html
ahh yeah that actually sounds smart
Cuvier’s Dwarf CaimanOP
I tried creating a directory with category.html and for child category, created a separate directory category/
it worked but this is not a proper way so looking for a genuine way
A proper way doesn’t exist
Unless you want to
app/category.html/page.tsx
app/category/settings.html/page.tsx
app/category.html/page.tsx
app/category/settings.html/page.tsx
Cuvier’s Dwarf CaimanOP
hmm ..then I have to go with customized routing only
@joulev Unless you want to
app/category.html/page.tsx
app/category/settings.html/page.tsx
Cuvier’s Dwarf CaimanOP
can you provide further details for the same?
@Cuvier’s Dwarf Caiman can you provide further details for the same?
app/category.html/page.tsx gives the /category.html route that’s all?
(category.html here is a folder not a file)