Automattic / Automattic/wp-super-cache
Pressing "update Mod_Rewrite Rules" not consistent with the message
- Dominant language
- PHP
- Stars
- 436
- Forks
- 130
- Avg merge
- 15h 11m
- Merged PRs (30d)
- 10
Description
I am using the expert option, and I see the following text:
> When Expert cache delivery is enabled a file called .htaccess is modified. It should probably be in the same directory as your wp-config.php. This file has special rules that serve the cached files very quickly to visitors without ever executing PHP. The .htaccess file can be updated automatically, but if that fails, the rules will be displayed here and it can be edited by you. You will not need to update the rules unless a warning shows here.
So it appears I don't need to do anything. Nevertheless I press "update Mod_Rewrite Rules", and then I get this message:
> Mod Rewrite rules must be updated!
>
> The plugin could not update /home/rstatis/public_html/.htaccess file: Page test failed as pages did not match with new .htaccess rules.
> Enable debug log on Debugging page for further details and try again.
> The new rules go above the regular WordPress rules as shown in the code below:
When I go to the .htaccess file I can see the code there (for some reason, on my server it can't update the files directly, so I have to do it manually. So it is clear the script can't do the update, but it should also recognize that the code is already there).
See also issue Automattic/wp-super-cache#926 and issue Automattic/wp-super-cache#925 that are related.
Thanks.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the expert cache delivery flow behind the “update Mod_Rewrite Rules” action and the existing .htaccess handling; no source file is named in the issue. Reproduce the case with the rules already present, enable the Debug log, and compare the displayed warning with the actual .htaccess contents. Done means the action and message correctly reflect whether the rules are already installed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100