[codex] Fix robots.txt text replacements#355
Open
imjlk wants to merge 4 commits intoSimply-Static:masterfrom
Open
[codex] Fix robots.txt text replacements#355imjlk wants to merge 4 commits intoSimply-Static:masterfrom
imjlk wants to merge 4 commits intoSimply-Static:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #159
Summary
robots.txt,llms.txt,_redirects, and_headersSitemap:directives inrobots.txtforabsoluteexportsrobots.txtis not overwritten by an unprocessed copyRoot cause
Plain-text file replacement was implemented outside the main URL conversion flow and handled in multiple places.
In typical WordPress setups, SEO plugins often add a
Sitemap:directive torobots.txtusing the live WordPress origin URL and a plugin-specific sitemap filename, such assitemap_index.xmlorsitemap.xml. That is correct on the live site, but when exporting withabsolutedestination URLs, the final staticrobots.txtshould point to the static destination URL instead of the origin host.This created two gaps:
robots.txtwas processed earlier in the export pipeline, the final Local Directory transfer could copy the original rule file again and overwrite the already-processed resultWith this change, text-file replacements go through shared utilities,
Sitemap:rewriting is limited toabsoluteexports, and final rule-file writes preserve the processed content.Validation
php -l src/class-ss-util.phpphp -l src/handlers/class-ss-text-file-handler.phpphp -l src/handlers/class-ss-rule-file-handler.phpphp -l src/integrations/class-ss-aio-seo-integration.phpphp -l src/integrations/class-ss-rank-math-integration.phpphp -l src/integrations/class-ss-yoast-integration.php