Unable to change rewrite urls

Hi all, I’m new to the forum, and like many of us, looking for help.

In a project that I have inherited from another professional, there is a url rewrite using js.

The link that is “domain.com / page.html” the code transforms in “domain.com / page” and the browser tries to open the directory instead of the page, returning an error.

This is done via the _buildManifest.js and _ssgManifest.js files.

I don’t have much experience with js and I have tried to change this, and to open the file directly without rewriting the url, but I haven’t been successful.

Can someone give me some guidance on this?

Thanks in advance

Both of your links go to a website, not to an easily accessible area of your code where you think the problem exists.

I’m not sure what this means (urls are what they are, not created with JavaScript), maybe someone else here does. Maybe more context would help you get an answer.

What file?

Hi eoja, thanks for your reply.

My project is not domain . com, I intended them to be an example of the link structure.

The situation is that I have a link that goes to “exampledomain . com / page.html”.

When I click in it, it changes to"exampledomain . com / page /", deletes te file extension and transform it in a directory.

What I have been able to see is that there are two files that handle this, _buildManifest.js and _ssgManifest.js.

This is the code of _buildManifest.js

self.__BUILD_MANIFEST = (function (a, b, c, d, e, f, g) {
    return {
        __rewrites: [],
        "/": [a, b, e, "static\u002Fchunks\u002Fpages\u002Findex-efa3973958b5df15c0bb.js"],
        "/404": ["static\u002Fchunks\u002Fpages\u002F404-59776675a7eebd88a29b.js"],
        "/_blank": [a, "static\u002Fchunks\u002Fpages\u002F_blank-0021772b5e45cb4802f7.js"],
        "/_error": ["static\u002Fchunks\u002Fpages\u002F_error-fcac238cd29f10acba43.js"],
        "/amenities": [a, b, "static\u002Fchunks\u002Fpages\u002Famenities-2647ca64c3de8ee87feb.js"],
        "/apartments": [a, b, "static\u002Fchunks\u002Fpages\u002Fapartments-68336fac519e99024e0e.js"],
        "/auth/signin": [a, c, "static\u002Fchunks\u002Fpages\u002Fauth\u002Fsignin-609ffcbcd0934996cbb4.js"],
        "/brokers": [a, "static\u002Fchunks\u002Fpages\u002Fbrokers-323cc421668b82bac8fd.js"],
        "/landings/[slug]": [a, b, c, d, e, "static\u002Fchunks\u002Fpages\u002Flandings\u002F[slug]-cc78e0372e4503927c17.js"],
        "/news": [f, a, c, d, g, "static\u002Fchunks\u002Fpages\u002Fnews-78841f517185e82d2c64.js"],
        "/news/[slug]": [f, a, c, d, g, "static\u002Fchunks\u002Fpages\u002Fnews\u002F[slug]-afd3cf02ac99a336d903.js"],
        "/resort": [a, b, "static\u002Fchunks\u002Fpages\u002Fresort-cf658f896052a9986fcf.js"],
        "/village": [a, b, "static\u002Fchunks\u002Fpages\u002Fvillage-a86b58340a75e9e23404.js"],
        sortedPages: ["\u002F", "\u002F404", "\u002F_app", "\u002F_blank", "\u002F_error", "\u002Famenities", "\u002Fapartments", "\u002Fauth\u002Fsignin", "\u002Fbrokers", "\u002Flandings\u002F[slug]", "\u002Fnews", "\u002Fnews\u002F[slug]", "\u002Fresort", "\u002Fvillage"]
}("static\u002Fchunks\u002F461b32dac3dbb5485b3ec6c217c66e72aaf11986.4e9b9998395ec156f016.js", "static\u002Fchunks\u002Ff7548a4ee73e3f4291265b06764ec04497aedb75.5f485e0d3a61908bdeef.js", "static\u002Fchunks\u002F087ad48b6054cd2939b19a465921611988358930.74c9f8642e1a7fc92a23.js", "static\u002Fchunks\u002F23c3ca523dd0d0c4de14f7a7f8b0af9226676ce2.e0ba728a952fcc6c4265.js", "static\u002Fchunks\u002F59c91cba89d4c3fc43fb08c6c900e755b7d0f687.3f36d016878883744f4c.js", "static\u002Fchunks\u002F75fc9c18.885ef66af4c0d3eae29b.js", "static\u002Fchunks\u002Fd3e8af792046f316f833cac6996146464c36f150.1519a72e7e20049c28b8.js"));

An this is the code of _ssgManifest.js

self.__SSG_MANIFEST = new Set(["\u002F_blank", "\u002Fapartments", "\u002Fbrokers", "\u002Famenities", "\u002Fresort", "\u002Fvillage", "\u002Fnews", "\u002F", "\u002Flandings\u002F[slug]", "\u002Fnews\u002F[slug]"]);

I may be wrong, but the feeling I get is that this is coming from these files.

Thanks again and best regards!

That looks like it might be Next.js? Which is a React framework. I haven’t used Next.js yet.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.