Open sr293 opened 1 year ago
Hi @sr293, since _redirects is a file, not an URL, if I place it under "Additional Files and Directories" it works as intended.
Was that set as well there or as "Additional URL"?
Setting:
Static Export:
I used the Additional Files and Directories setting and it did not work. The files were unfortunately renamed. In this example I'm using Local by Flywheel to more closely match your test example. In your screenshot it appears to be working how I would want it to. Is there some other setting I should change or update?
Here is the debug log export from my test.
@chrisdavidmiles
I couldn't replicate it now with the next release (tested on Linux + Mac with LocalWP) and exported it as ZIP and Local Directory.
I also switched to multiple locations for the export to be sure it's not an edge case from the path itself.
So as long as these files are included in Simply Static -> Settings -> Include/Exclude -> Additional Files and Directories, that should work well.
There might be some issues from the filesystem that we can't replicate (maybe a .htaccess file blocks placing files in the root?), but nothing is blocking from within Simply Static anymore (next release).
@patrickposner
That's great news! When do you expect the new version with the fix to be released? I'm currently using version 2.3.0.
Great to hear, we're manually copying these files in now for Cloudflare Pages
@patrickposner you mentioned this was fixed in the next release, but the bug still exists on version 2.3.1.
Any update on this?
Has this issue been fixed, I'm finding _redirects being converted into /_redirects/index.html
Is there any update on this issue?
Great to hear, we're manually copying these files in now for Cloudflare Pages
Hi @derekperkins. Since this is still an unresolved issue in Simply Static, how were/are you copying the files manually into Cloudflare Pages?
@isatisfy The only way I've got it to work is to unzip the simplystatic folder and then rename the _/redirects/index.html file to redirects and move it into the root (out of the /redirects/ folder). I then upload the whole simplystatic export.
Sorry for the late reply, but we do exactly what @rpardz suggested. We're working through some issues with the GitHub integration, and my hope is that we can add those files there, so we don't have to keep manually copying them.
Just tested this today and it has not been fixed. Exporting _redirects still converts to a folder /_redirects/ with an index.html enclosed.
When including a plain text config file with no extension for compatible services (Netlify, Gitlab Pages, Cloudfront Pages, etc.) the file is being treated like an HTML page which is producing an incorrect filename.
Example: ~/_redirects gets changed to ~/_redirects/index.html
It appears to be treated like an HTML page endpoint and not a file. When a file extension is present, like on ~/robots.txt, the generated file works as expected.
Steps to replication:
The redirect file in root with no file extension:
Generated folder and index.html from file:
Site info from test site: siteinfo.txt