2

I have a very basic website https://myappname.example with only a home page that allows users to go and download my app from Apple store or Google play.

I have a use case when user can click on dynamic link. For example: https://myappname.example/12343432 when 12343432 is a PostId. Today what happen is that this shows a 404 error because this page does not exist.

When someone tries to open this link, instead of the standard 404 page error a page, I would like to show a custom 404 page with the id in the middle and the user can click to copy the id to the clipboard to be used after inside the mobile app. Is this possible? If yes, can someone help with example?

0
2

You should create a .htaccess file in the app directory and add this line in it:

ErrorDocument 404 /error404.html

Then create a custom 404 page with that name: error404.html. Or use a different name if you want to use a programming language. If you have a programming language in mind that you would like to use, say it and I could help more.

3
  • today I'm using google site to return this basic home page because I'm not comfortable to do web development :), and to handle my use case I want to migrate to Firebase hosting, so it's mean I need to write the home page, the error404 page and deploy it to firebase ( example : youtube.com/watch?v=qbxj_36UkWs ), so I think any language allow me to deploy this use case can help, if there is a simple git project to handle this it will be appreciate Jan 11 at 14:10
  • 1
    Google sites has close to zero functionality for dynamic content. I think you are going to have to host your site somewhere else if you want it to work the way you describe. Jan 11 at 20:07
  • yes, I did a quick website and deploy it to firebase hosting. I used flutter framework and I redirect my expected url to a custom widget, all what we need to do is : inside generateRoute we should capture the postId and return a custom widget with the value Jan 15 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.