The question is not descriptive enough and it is extremely poorly written. A user has no idea what problem you are facing, what tools are you using and what you are trying to ask. He simply looses attention by reading the first sentence. If you cannot grab user attention in the first sentence, it is poorly written.
Suggestions:
Replace
Using .htaccess and ErrorDocument 404 /error.php, if access an invalid
url eg.: http://example/css/invalid-file.css:
to
In my .htaccess I have set ErrorDocument as follows
ErrorDocument 404 /error.php
if I access an invalid URL for example http://example/css/invalid-file.css, I get the following output
REDIRECT_STATUS: 404
REDIRECT_URL: /css/invalid-file.css
REDIRECT_REQUEST_METHOD: GET
My error.php is set as follows
echo 'REDIRECT_STATUS: ', $_SERVER['REDIRECT_STATUS'], PHP_EOL,
'REDIRECT_URL: ', $_SERVER['REDIRECT_URL'], PHP_EOL,
'REDIRECT_REQUEST_METHOD: ', $_SERVER['REDIRECT_REQUEST_METHOD'];
and so on
That way you carry the user along with you and he can quickly understand what you are asking.
Conclusion
Some suggestions when asking questions
- Make question a little bit personalized, what problem you are facing?
- Get a background of the problem and what you have tried and what is not working.
- Give an a proper insight into the technologies you are using.
A
andA
is not working because ofB
, and you do not know aboutB
that much; you'd be searching and asking for the problem ofA
rather than directly deciding to check onB
. I am personally not a PHP developer and I cannot give a clear definition whether the question is easy to solve or not. In case a simple google research could lead toB
the question should be flagged, but not sure if really off-topic is the appropriate reasoning. If not, then SO will be the resource to lead toB
, which I belive is part of its purpose.