Articles on: 🌍 Web Hosting
This article is also available in:

How do I configure custom redirects and HTTP headers with Hodifly?

Hodifly supports _redirects and _headers files, similar to Netlify, for static sites. Place them at the root of your published output (the build folder configured on Hodifly).


These files apply to static deployments. Node and Python apps handle their own routing and headers in code.


_redirects


One rule per line: source destination [status]. Blank lines and # comments are ignored. If you omit the status, 301 is used.


# permanent redirect
/old-page /new-page 301

# temporary redirect
/promo /summer-sale 302

# redirect to an external site (full URLs are kept as-is)
/discord https://discord.gg/xyz 302

# wildcard: :splat matches everything captured by the trailing *
/blog/* /news/:splat 301

# SPA fallback: serve index.html for any unknown path (status 200 = rewrite, URL unchanged)
/* /index.html 200


Good to know:


  • Real files and folders take precedence first. An existing file or directory is always served before any redirect rule: your assets keep working, and an SPA fallback /* → /index.html 200 only kicks in for paths that don't exist on disk.
  • Status 200 means rewrite (serve the destination without changing the URL): this is what makes single-page app fallbacks work.
  • :splat is the only supported pattern; it captures everything matched by a trailing *.
  • Query strings are preserved during redirects and rewrites.


Not supported (stick to the subset above): named patterns such as /:year/:month, conditional rules (country, language, cookie, role), and forcing indicators (force flags).


_headers


A path line starting with /, followed by indented Name: value header lines. # comments are ignored.


# apply to every response
/*
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin

# apply only under a specific path
/assets/*
Cache-Control: public, max-age=31536000, immutable


Good to know:


  • /* or / applies the headers to the entire site.
  • A specific path like /assets/* applies them to requests under that path.

Updated on: 17/07/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!