0

This works :

<Link href="/about" passHref={true}><a className="hover:text-gray-400" rel="noreferrer">About</a></Link>

So when I run mydomain.com and click the About link, it goes to mydomain.com/about

But when I hard-refresh mydomain.com/about it returns 404 since the export has exported the file to mydomain.com/about.html - so how do I change the links to about.html in the Link tag ? Because changing it to /about.html returns 404 in dev.

anjanesh
  • 3,771
  • 7
  • 44
  • 58
  • Does this link help> https://stackoverflow.com/a/62901065/13749957 – Ramakay Jan 26 '22 at 14:12
  • I don't like the fact that `exportTrailingSlash: true,` created a folder with a single index.html in it for every route I have. – anjanesh Jan 26 '22 at 15:51
  • For now I have found a solution on a server that supports Rewrites like Apache's http. `RewriteRule ^about$ about.html` – anjanesh Jan 26 '22 at 16:37
  • I use an AWS lambda function to resolve the correct route. If you're using AWS and CloudFront, I can post the function. – Sean W Jan 26 '22 at 21:39
  • Can you please let me know what the function is for AWS Lambda ? I have not yet tried AWS Lambda but am interested in it nevertheless. – anjanesh Jan 27 '22 at 02:48

0 Answers0