• I have statically generated WordPress website (with plugin called Staatic). I used option Offline Usage which recommends to make static content to be run on local machine and static web hosting. But after I visit web root index.html and other index.html files (which are under directories with names of web pages), everytime it includes index.html at the end of each URL.

    with index.html —> https://domain.com/index.html , https://domain.com/page-name-here/index.html

    What I want is to remove /index.html at the each file URL. So it looks;

    https://domain.com/page-name-here/index.html

    WordPress is running on NGINX. WordPress, plugins are updated.

    Any help to solve this issue would be appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Team Staatic

    (@staatic)

    Hi @kavish895,

    When using the “Offline URL” option in Staatic, it generates relative links for static content, which is useful for viewing the site without a web server, using file:// URLs. In this case, each page’s index.html must be explicitly referenced because there’s no server to interpret URLs and serve the default index file.

    Could you clarify how you’re running your static site locally? Are you using a web server like Nginx, or are you opening the files directly in your browser?

    If you’re using Nginx, you can set a regular destination URL under Build settings, like / or https://www.mysite.local/, depending on your web server configuration. This approach allows Nginx to handle URL requests and serve default index files without needing to specify index.html.

    If you’re opening files directly in your browser, the index.html must be included in the URL. What is your reason for wanting to omit index.html in this setup?

    Thread Starter kavish895

    (@kavish895)

    Thank you for quick response. I wanto upload static files into Fleek.xyz hosting with custom domain. So I can run website without server backed website m own. Fleek suggest to make static generation offline-first (https://fleek.xyz/guides/hosting-on-ipfs-best-practices-troubleshooting/). So, I used that option. I wanto exclude /index.html part on my website.

    Plugin Author Team Staatic

    (@staatic)

    Thank you for clarifying your use case.

    To address your requirement of excluding the /index.html part from URLs, we’ve added an experimental option in the development version of the Staatic plugin. You can download this version by going to the plugin’s page advanced view, navigating to Previous Versions under Advanced Options, and choosing the Development Version. Once downloaded, update your plugin to this version.

    After updating, go to Staatic > Settings > Build, where you will find the option “Append /index.html to directory URLs”. Uncheck this option and click Save Changes at the bottom of the page. Then, start a new publication to apply these settings.

    Please let us know if this resolves your issue or if you need further assistance.

    Thread Starter kavish895

    (@kavish895)

    Thank you for quick development, but just removing /index.html doesn’t resolve the issue. I tried it removing index.html manually, when doing so it shows off directory navigation of that location. It’s same with deselecting Append?<code>/index.html</code>?to directory URLs. Meaning, I still have to click on index.html from that page directory to view the web page.

    Plugin Author Team Staatic

    (@staatic)

    Thank you for the update. It seems that Fleek.xyz hosting might require the index.html for directory URLs to work properly. To better assist you, could you share the URL to your site? If you prefer to keep this information private, you can email it to [email protected]. Thanks!

    Plugin Author Team Staatic

    (@staatic)

    Hi @kavish895, just checking in to see if there are any updates on the directory URL issue. If you could share your site URL or any updates on your end, that would be helpful.? Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.