Wp-rocket: Add a filter to keep empty lines in the htaccess file

Created on 9 Sep 2016  路  7Comments  路  Source: wp-media/wp-rocket

A customer requested that we don't remove empty lines when writing in the htaccess file. We could add a filter in htaccess.php to allow that

question

Most helpful comment

Just documenting another complaint about this: https://secure.helpscout.net/conversation/348083233/37873/?folderId=273761
Agree with all above - we should only touch our own rules and not any other part of the file.

All 7 comments

What is the reason to not remove the empty lines?

Here is the ticket: https://secure.helpscout.net/conversation/248648885/21997/?folderId=637040

It's for clarity in its own rewrite rules

Here is another customer complaining about WP Rocket removing line breaks: https://secure.helpscout.net/conversation/253019688/22587/?folderId=714999#thread-671714143

The background assumption behind this complaint seems to be the why exactly rather than the why not. The customer seems to argue from the notion that our plugin should only touch file content it has created itself. Personally, as a user I would have to agree.

+1 for this one.
@GeekPress: what is the reason to remove the empty lines?

I agree: It's annoying that WP Rocket strips out blank lines elsewhere in the .htaccess file. I add blank lines in my .htaccess files (usually between groups of redirects or other directives) because it improves legibility and therefore reduces time and errors.

Just documenting another complaint about this: https://secure.helpscout.net/conversation/348083233/37873/?folderId=273761
Agree with all above - we should only touch our own rules and not any other part of the file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

webtrainingwheels picture webtrainingwheels  路  5Comments

webtrainingwheels picture webtrainingwheels  路  5Comments

jbma picture jbma  路  5Comments

piotrbak picture piotrbak  路  4Comments

NataliaDrause picture NataliaDrause  路  4Comments