0

i am a newbie. just tried to create simple site using firebase hosting . index.html page is opening but when i click on a list item to open it , it shows error 404 . index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Kids Moral Stories in Hindi and English</title>
    <base href="https://myshowtv-23.web.app" target="_blank">
</head>
<body style="background-color: #fcde67;">
    <div style="text-align: center;  font-size: xx-large; font-weight: 900; text-decoration-color: black; text-decoration: solid; text-decoration-line: underline;">
        <h1 style="color: #1c4858;">My Show Tv</h1>
    </div>
    <div style="text-align: center;">
        <h2 style="color: #030e12; text-decoration:dotted; text-decoration-line:underline; text-decoration-color: #1c4858;
         font-size:xx-large; font-weight: 800;"> हिंदी शिक्षाप्रद कहानियां / HINDI MORAL STORIES   </h2>
    </div>
    <ul style="font-size: xx-large;"    >
        <li style="margin-bottom: 10px;">
            <a href="/public/h1_शिकंजी का स्वाद.html" target="_blank" >शिकंजी का स्वाद</a>
        </li>
        <!-- <li style="margin-bottom: 10px;">
            <a href="/myshowtv/h2_एकता में बल है.html" target="_blank" >एकता में बल है</a>
        </li>
        <li style="margin-bottom: 10px;">
            <a href="/myshowtv/h3_शेर और मच्छर की कहानी.html" target="_blank" >शेर और मच्छर की कहानी</a>
        </li>
        <li style="margin-bottom: 10px;">
            <a href="/myshowtv/h4_आलसी गधा.html" target="_blank" >आलसी गधा</a>
        </li>
        <li style="margin-bottom: 10px;">
            <a href="/myshowtv/h5_श्रेष्ठ कौन.html" target="_blank" >श्रेष्ठ कौन ? </a>
        </li> 
        <li style="margin-bottom: 10px;">
            <a href="/myshowtv/h6_उपकार कभी व्यर्थ नहीं जाता.html" target="_blank" >उपकार कभी व्यर्थ नहीं जाता</a>
        </li>  
        <li style="margin-bottom: 10px;">
            <a href="/myshowtv/h7_सच्चा शासक.html" target="_blank" >सच्चा शासक</a>
        </li>   -->
        
    </ul>
    
    
</body>
</html>

firebase.json

{
  "hosting": {
    "site": "myshowtv-23",
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

list item h1_शिकंजी का स्वाद.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>शिकंजी का स्वाद-हिंदी शिक्षाप्रद कहानियां-HINDI MORAL STORIES-My Show Tv</title>
</head>
<body style="background-color: #fcde67; ">
    <div style="text-align: center;  font-size: xx-large; font-weight: 900; text-decoration-color: black; text-decoration: dotted; text-decoration-line: underline;">
        <h1 style="color: #1c4858;">शिकंजी का स्वाद</h1>
    </div>
    <!-- <hr> -->

    <p style="color: #36454F; font-size: xx-large; margin: 10%;">
        
        एक प्रोफेसर क्लास ले रहे थे । क्लास के सभी छात्र बड़ी ही रुचि से उनके लेक्चर को सुन रहे थे , उनके पूछे गए सवालों के जवाब दे रहे थे , लेकिन उन छात्रों के बीच कक्षा में एक छात्र ऐसा भी था जो चुपचाप और गुमसुम बैठा हुआ था । प्रोफेसर ने पहले ही दिन उस छात्र को नोटिस कर लिया , लेकिन कुछ नहीं बोले । <br><br>लेकिन जब चार से पांच दिन तक ऐसा ही चला तो उन्होंने उस छात्र को क्लास के बाद अपने केबिन में बुलवाया और पूछा ,  तुम हर समय उदास रहते हो क्लास में अकेले और चुपचाप बैठे रहते हो , लेक्चर पर भी ध्यान नहीं देते । क्या बात है ?  कुछ परेशानी है क्या ?<br><br>
         सर , वह छात्र कुछ हिचकिचाते हुए बोला  , मेरे अतीत में कुछ ऐसा हुआ है जिसकी वजह से मैं परेशान रहता हूं , समझ नहीं आता क्या करूं।<br><br>
         प्रोफ़ेसर भले व्यक्ति थे , उन्होंने उस छात्र को शाम को अपने घर पर बुलवाया शाम को जब छात्र प्रोफ़ेसर के घर पहुंचा तो प्रोफ़ेसर ने उसे अंदर बुला कर बैठाया और
          स्वयं किचन में चले गए और शिकंजी बनाने लगे । उन्होंने जानबूझकर शिकंजी में ज्यादा नमक डाल दिया फिर किचन से बाहर आकर शिकंजी का गिलास छात्र को 
          देकर कहा यह लो शिकंजी  पियो । छात्र ने गिलास हाथ में लेकर जैसे ही एक घूंट पिया ,  अधिक नमक के स्वाद के कारण उसका मुंह अजीब सा बन गया । यह
           देख प्रोफ़ेसर ने पूछा , क्या हुआ शिकंजी पसंद नहीं आई ?<br><br>
        नहीं सर , ऐसी बात नहीं है बस शिकंजी में नमक थोड़ा ज्यादा है , छात्र बोला ।
        प्रोफ़ेसर बोले , अरे अब तो यह बेकार हो गई , लाओ गिलास मुझे दो मैं इसे फेंक देता  हूं । प्रोफ़ेसर ने छात्र से  गिलास लेने के लिए अपना हाथ बढ़ाया लेकिन छात्र ने मना करते हुए कहा नहीं सर बस नमक ही तो ज्यादा है ,  थोड़ी चीनी और मिलाएंगे तो स्वाद ठीक हो जाएगा ।<br><br>
         यह बात सुनकर प्रोफ़ेसर गंभीर हो गए और बोले ,  सही कहा तुमने अब इसे समझ भी जाओ , यह शिकंजी तुम्हारी जिंदगी है , इसमें घुला अधिक नमक तुम्हारे अतीत के बुरे अनुभव हैं ।
         जैसे नमक को शिकंजी से बाहर नहीं निकाल सकते वैसे ही उन बुरे अनुभवों को भी जीवन से अलग नहीं कर सकते । वे बुरे अनुभव भी जीवन का हिस्सा ही हैं । लेकिन जिस तरह हम चीनी घोलकर हम शिकंजी का स्वाद बदल सकते हैं , वैसे ही बुरे अनुभवों को भूलने के लिए जीवन में मिठास तो घोलनी पड़ेगी ना  ।
        इसलिए मैं चाहता हूं कि तुम अब अपने जीवन में मिठास घोल लो ।<br><br>
        प्रोफ़ेसर की बात छात्र समझ गया और उसने निश्चय किया कि अब वह बीती बातों से परेशान नहीं होगा ।
         
    </p>
    <div style="text-align: center;  font-size: xx-large; font-weight: 900; text-decoration-color: black; text-decoration: dotted; text-decoration-line: underline;">
        <h1 style="color: #1c4858;">सीख</h1>
    </div>
    <p style="color: #36454F; font-size: xx-large; margin: 10%;">
        जीवन में अक्सर हम अतीत की बुरी यादों और अनुभवों को याद कर दुखी होते रहते हैं । इस तरह हम अपने  वर्तमान पर ध्यान नहीं दे पाते और कहीं ना कहीं अपना भविष्य बिगाड़ लेते हैं जो हो चुका उसे सुधारा नहीं जा सकता लेकिन कम से कम उसे भुलाया तो जा सकता है और उन्हें भुलाने  के लिए नई मीठी यादें हमें आज बनानी होंगी।
        जीवन में मीठे और खुशनुमा लम्हों को लाइए तभी तो जीवन में मिठास आएगी ।
    </p>

    <hr>
    <div style="text-align: center;  font-size: xx-large; font-weight: 900; color: #1c4858;">
        <h1>धन्यवाद</h1>
    </div>
    <br>
    <div style="text-align: center;">
        <a href="https://www.youtube.com/watch?v=2yAai1wAGYM&list=PLSiNQmsZ66GihMbdPNDuVGWDyQoqFf0II&index=1" target="_blank"> <img src="/myshowtv/youtube-logo-nuevo-removebg-preview.png" alt="Youtube"></a>
    </div>
    <div style="text-align: center; font-size: xx-large;" >
        <h3> <a href="https://www.youtube.com/watch?v=2yAai1wAGYM&list=PLSiNQmsZ66GihMbdPNDuVGWDyQoqFf0II&index=1" target="_blank" >वीडियो कहानी देखें- YouTube पे -सच्चा शासक  </a> </h3>
    </div>
    <div style="text-align: center; font-size: xx-large;margin: 5%;" >
        <h3> <a href="https://www.youtube.com/watch?v=2yAai1wAGYM&list=PLSiNQmsZ66GihMbdPNDuVGWDyQoqFf0II&index=1" target="_blank" >Watch Same Story in English on Youtube</a> </h3>
    </div>
    
</body>
</html>

cmd terminal after firebase deploy command

C:\Users\Acer\Desktop\html try>firebase deploy

=== Deploying to 'myshowtv-4a2f9'...

i  deploying hosting
i  hosting[myshowtv-23]: beginning deploy...
i  hosting[myshowtv-23]: found 61 files in public
+  hosting[myshowtv-23]: file upload complete
i  hosting[myshowtv-23]: finalizing version...
+  hosting[myshowtv-23]: version finalized
i  hosting[myshowtv-23]: releasing new version...
+  hosting[myshowtv-23]: release complete

+  Deploy complete!

Project Console: https://console.firebase.google.com/project/myshowtv-4a2f9/overview
Hosting URL: https://myshowtv-23.web.app

C:\Users\Acer\Desktop\html try>

the same is happening on live server on vs code .

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Pros Cons
  • 1
  • 6

1 Answers1

1

From this line in your log output, there were 61 files deployed:

found 61 files in public

If that sounds like a reasonable number of files for your website, my guess is that you have the wrong path for the links. So change from this:

 <a href="/public/h1_शिकंजी का स्वाद.html" ...

To:

 <a href="/h1_शिकंजी का स्वाद.html" ...

And run firebase deploy again.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • thankyou sir, it worked please can you tell the reason for it . – Pros Cons Mar 29 '23 at 10:59
  • Also 61 files was correct. but now i have updated my content in one of the page but it is still showing old content, similar problem like '''https://stackoverflow.com/questions/71668281/firebase-still-old-version-after-deploy-to-hosting-how''' . i don't have build in package.json as answered. i didn't understand where to write the cache control thing specified in '''https://firebase.google.com/docs/hosting/manage-cache ''' . Thanks again sir! – Pros Cons Mar 29 '23 at 11:26
  • Reason: you have the wrong path in your HTML here `/public/h1_शिकंजी का स्वाद.html`. After you deploy the website to Firebase Hosting, those files are actually in the root of your web site, so `/h1_शिकंजी का स्वाद.html` --- If you have an additional problem after fixing this one, please post a new question for that. – Frank van Puffelen Mar 29 '23 at 13:58
  • thanks frank sir for help. I got answer to my problem, added code of abraham sir to my firebase.json https://stackoverflow.com/questions/38114755/cache-control-header-in-firebase-json-not-working . Might be helpful for others . Thanks ! – Pros Cons Apr 01 '23 at 07:41