How do I rewrite the path of my link with my custom domain?

How do I rewrite the path of my link with my custom domain? In other words, how do I make my custom domain not have “.html” at the end of the hyperlink? Think something like mod_rewrite but for Repl
Repl link:

code snippet

Hi @j4db2tgd5z , welcome to the forums!
To do this, you’ll have to use app routes.
A backend server (Python, Node.js) will have to be used, paired with a web framework (Flask, Express).
I made a tutorial about this, using Python and HTML.

Hope this helps!

Hi @j4db2tgd5z !
You can also take a look at this topic:

Hope this helps!

Hi and welcome! I don’t think you got the link to your repl into the question but an alternative simple option that depends on the footprint of the site is to use directories with an index.html in each. For example, if you could use the following file structure:


And that would support:


Welcome to the forums, @j4db2tgd5z!
There are a few ways to do this.

  1. You could do what @NateDhaliwal said about using a backend such as Flask.
  2. You could also use a GitHub Repository, as GitHub allows the use of .htaccess files. Check out this wiki on how to use a Git Repo: How To Connect A Git Repo to your Repl! - General - Replit Ask
  3. Finally, you can also make a folder with the name of the url path you want to use and put a index.html file within that folder. That will allow you to access a URL at for example, instead of

Feel free to ask me if you need some help!

1 Like

I think the best way is just making a folder called the page name e.g. about and then putting your file in the folder, renaming it to index.html. Here’s why this works:

When you name your file index.html, you’re able to go to and see it. This is because index is the name of the default HTML that is a folder navigation. But since you replace that HTML file, it leads to yours when you go to the root directory. The same thing works within folders. Usually if you had a folder named about and went to /about, it would list all files in about. But adding an index.html in there replaces that page, essentially making your URLs have no file extension.

1 Like