htaccess-validator
htaccess-validator copied to clipboard
Servername example.com doesn't exists
On ubuntu or debian that domain in apache doesn't exist but the validate-htaccess command use it: https://github.com/liquidweb/htaccess-validator/blob/develop/bin/validate-htaccess#L43
I did a gist with some modification so don't require anymore composer and support also stdin with install instructions https://gist.github.com/Mte90/c6568811cd38b60cf05f0e9d8f16bc7a
@Mte90 Do you happen to have a specific error message you can share? The -C directive explicitly includes a directive before processing the rest of the rule, so the -C "ServerName example.com" is designed to set a default server name in environments where one might not explicitly be set.
#7 also adds Debian support (which I've verified against local Ubuntu VMs), so I'd love your feedback if updating to the version of the script from that PR solves the issues you're seeing.
Yes, no problem. I am using it on my Debian machine (I use linux everywhere) and also on my VPS. So the new feature of my script are based on the pending pull requests and more stuff:
- Now supports stdin or a file for htaccess rules
- A parameter to define the domain where will inject on the fly the new rules, default is
example.com - Remove
RewriteBaserule that can create errors from the file passed to the htaccess - In case of htaccess error, print it
I can do a pr with that script but I am already using in production as it is on my gist. I integrated also on a test suites for a tool that generate htaccess stuff we are developing for our customers.
I'll dig into the gist further and reconcile those changes with what's already been done in #6 and #7.
I integrated also on a test suites for a tool that generate htaccess stuff we are developing for our customers.
How did you guess why this package was developed? :wink:
Ahahah yes, we were looking for the same thing.