New answers tagged

1

ErrorDocument 404 https://doamin.com/error.php You need to use a root-relative URL-path, not an absolute URL in the ErrorDocument directive. If you specify an absolute URL then it will trigger a 302 redirect to the error document (and a 200 OK response when the error document is served) and consequently, any information about the request that caused the ...


0

This does redirect: RewriteCond "www.%{ENV:DOMAIN_NAME}" "!=%{HTTP_HOST}" Because server variables of the form %{VARNAME} are not expanded in the CondPattern (2nd argument to the RewriteCond directive). You are comparing against the literal string "%{HTTP_HOST}", which is obviously different to "www.localhost.com", so ...


1

But, what are the file types that ExpiresDefault will work on ? As you've stated, "the rest". Any responses that are not covered by the mime-types stated in the preceding ExpiresByType directives are covered by the ExpiresDefault directive. So, from the directives you posted, this will include HTML (text/html), JS (application/javascript), CSS (...


1

These two directives are the same. The plus keyword is entirely optional. It is just syntactic sugar, to make it (arguably) more "readable". As stated in the Apache docs for mod_expires: ExpiresByType type/encoding "base[plus num type] [num type] ..." : The plus keyword is optional. So, include it or not - it is up to you. But, as with ...


3

Just a few notes regarding your existing directives: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^pdfs/([^/]*)/([^/]*)/([^/]*)/([^/]*)$ /pdftools/openpdf.php?file=$1&task=$2&dsp=$3&id=$4 [L] RewriteRule ^pdfs/([^/]*)/([^/]*)/([^/]*)$ /pdftools/openpdf.php?file=$1&task=$2&dsp=$3 [L] RewriteRule ^...


Top 50 recent answers are included