Overview
When using Supabase Edge Functions for dynamic sitemaps or APIs, your URLs look like:Why Proxy Supabase URLs?
- Flatten sitemap nesting: Google only follows one level of nesting in sitemap indexes. If your static
sitemap.xmlpoints to a<sitemapindex>on Supabase which contains sub-sitemaps, Google won’t discover them. Proxying/sitemap.xmldirectly to your Edge Function flattens this to one level - Better SEO: Search engines prefer sitemaps served from your own domain
- Professional branding: No third-party URLs visible to users
- Flexibility: Change backends without updating references
- Trust signals: Links stay on your domain
Set Up with Hado SEO Routing Rules
Hado SEO’s routing rules let you proxy paths on your domain to your Supabase Edge Functions with no code changes.Open Routing Rules
In your Hado SEO Dashboard, select your domain and go to the Routing Rules tab.
Add a Proxy Rule
Click Add Rule and configure:
Replace
| Field | Value |
|---|---|
| Rule Type | Proxy |
| Source Path | /sitemap.xml |
| Target URL | https://YOUR_PROJECT_REF.supabase.co/functions/v1/sitemap |
YOUR_PROJECT_REF with your Supabase project reference.Add More Rules (Optional)
If you have additional Supabase endpoints, add proxy rules for each:
| Source Path | Target URL |
|---|---|
/sitemap.xml | https://YOUR_PROJECT_REF.supabase.co/functions/v1/sitemap |
/api/posts/* | https://YOUR_PROJECT_REF.supabase.co/functions/v1/posts |
Bulk Import via CSV
If you have many endpoints to proxy, use CSV import:Update robots.txt
Make sure your robots.txt references the proxied sitemap:Testing Your Setup
1. Direct Access Test
200 OK with Content-Type: application/xml or Content-Type: text/xml.
2. Content Verification
3. Google Search Console
Submit the sitemap in Search Console and verify no errors.Troubleshooting
502 Bad Gateway
502 Bad Gateway
The proxy can’t reach Supabase.Check:
- Supabase function URL is correct
- Function is deployed and working
- No typos in project reference
Empty response
Empty response
Proxy returns empty content.Check:
- Supabase function returns data when called directly
- The source path in your routing rule matches the URL you’re visiting
Wrong content type
Wrong content type
Response has incorrect Content-Type header.Check:
- Your Supabase function sets the correct
Content-Typeheader (e.g.,application/xmlfor sitemaps)