Rewrite every url to index.html

171 views
Skip to first unread message

Osman

unread,
Sep 24, 2017, 1:57:12 AM9/24/17
to Firebase Google Group
Apologies if this is an obvious problem to solve, but I've searched everywhere and could not find the issue.

I'm trying to rewrite every url to go to my index.html but it's only working for the first subfolder ( www.test.com/something ) and not for any folders below it ( www.test.com/something/else ).

My rewrite rules are like the one in the docs:

"hosting": {
// Add the "rewrites" section within "hosting"
"rewrites": [ {
"source": "**",
"destination": "/index.html"
} ]
}

Warnings that I get: Resource interpreted as Stylesheet but transferred with MIME type text/html
Errors that I get: Uncaught SyntaxError: Unexpected token <

Thank you and kind regards,
Osman

Michael Bleigh

unread,
Sep 24, 2017, 2:42:31 AM9/24/17
to fireba...@googlegroups.com

The rewrite you describe definitely covers subfolders. We'll need more specifics to help debug, like the actual deployed URL that isn't working. If you don't want to share publicly, feel free to reach out to support!


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/96a0a4b3-f62b-4313-944f-ed6860c6f75e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Osman

unread,
Sep 25, 2017, 2:41:12 PM9/25/17
to Firebase Google Group
Hi Michael,

I don't mind sharing the URL: https://steamlist.net/test/ works but https://steamlist.net/test/test shows the ustyled page. 

Apologies if I'm doing something super silly, never built a website before, firebase is opening a ton of new doors for me, so trying to learn as much as I can :)

Cheers,
Oz

Michael Bleigh

unread,
Sep 25, 2017, 2:49:33 PM9/25/17
to Firebase Google Group

You’re using relative URLs for your scripts/stylesheets, which means that it’s looking for the stylesheets in a subdirectory. You should either use absolute URLs to reference them (e.g. /css/stylesheet.css) or use the tag to set a link root.


Osman

unread,
Sep 25, 2017, 6:53:44 PM9/25/17
to Firebase Google Group
Ah! Thank you! It all works as expected now.

Kind regards,
Osman
Reply all
Reply to author
Forward
0 new messages