22

I had a question for a long time that I later solved and shared the answer to, which I believe will be useful to other users. However, the question was downvoted. I would just like to know if there is something wrong with the question.

I think it's just an arbitrary downvote, but it may be that my question is really bad and I can not notice my error (if any).

I know it's not possible to know the reason of the downvote, but I wonder if there is any problem with the question.

Question: Retrieve REDIRECT_STATUS with error_page

How can I improve this question?

22
  • 13
    Never change, Meta. Never change.
    – BoltClock Mod
    Commented Jun 21, 2015 at 16:56
  • 2
    @BoltClock excuse me, I did something wrong? if I'm sorry, I could guide me?
    – Korvo
    Commented Jun 21, 2015 at 16:57
  • 19
    You didn't. Some people on meta just don't like questions about downvotes I guess, even if they're simply asking how to improve their question in general.
    – BoltClock Mod
    Commented Jun 21, 2015 at 16:57
  • 1
    I hope the latest edition helps. But really I'm a little discouraged. @BoltClock - Thanks again, good bye :)
    – Korvo
    Commented Jun 21, 2015 at 17:27
  • 2
    There was more than a single person who disapproved before your comment @Bolt? Oh, well. Commented Jun 21, 2015 at 18:08
  • The question does not appear to actually be about PHP programming, it's about how to set up nginx. Commented Jun 22, 2015 at 8:19
  • 2
    That question is barely on topic. Like hanging on the furthest outcrop of on-topicness with the nail of your pinkey finger. People tend to downvote off topic questions.
    – user1228
    Commented Jun 22, 2015 at 17:29
  • @Will Do you recommend that I delete this question?
    – Korvo
    Commented Jun 22, 2015 at 17:31
  • 1
    I said it's barely on topic, which means it's on topic. I disagree with .htaccess questions being allowed, but that was decided long ago. So, no, I don't suggest you delete it.
    – user1228
    Commented Jun 22, 2015 at 17:32
  • @Will The thought you were talking about this question. I'd better ask the serverfault?
    – Korvo
    Commented Jun 22, 2015 at 17:34
  • 1
    No, as I said "That question is barely on topic." You'd have to consult SF's stance on .htaccess questions. Check their Help link and look at their htaccess tag question list. Server config questions are definitely home there.
    – user1228
    Commented Jun 22, 2015 at 17:36
  • 11
    @Will: Perhaps, when someone is not quite understanding you, repeating the same words over and over again is not the most constructive course of action? Just a thought mate. Commented Jun 22, 2015 at 23:33
  • 3
    @BlueRaja-DannyPflughoeft, the question you say is off topic, as it is not about PHP, but Nginx. Try to look it from OP perspective - the OP experiences an issues in PHP and it seems that there is an obscure workaround in Nginx that is the issue cause. By the time of asking, the problem is not Nginx related to the OP at all, and it is not the first question to fall into such category. I'd use the self-invented term "shifting topic" for such questions. Take for example the above question: other PHP devs could experience the same and the answer will lead them to the Ngnx fix.
    – stackh34p
    Commented Jun 23, 2015 at 7:55
  • 3
    @BlueRaja-DannyPflughoeft, my point is that if you do A and A is not working because of B, and you do not know about B that much; you'd be searching and asking for the problem of A rather than directly deciding to check on B. 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 to B 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 to B, which I belive is part of its purpose.
    – stackh34p
    Commented Jun 23, 2015 at 8:00
  • 2
    Don't pay any attention to upvotes/downvotes, the site is simply broken by achievements in my opinion, so you have here different kind of people like edit-nazis (that one space you posted in the code was completely unnecessary), downvoters, upvoters etc. I wouldn't care too much about that sort of stuff. If you got the answer thanks to someone or thanks to yourself what's the big deal? Don't cry about it and move on, it's not a facebook to start a drama every time someone downvotes you.
    – user4029967
    Commented Jun 24, 2015 at 4:52

3 Answers 3

21

I think the first few sentences could be improved.

Especially, when you mix both application programming and sys-admin as tags (php and nginx server configuration); you have to spell out the question really clearly.

There tends to be a cognitive bias where one thinks that a person reading has more information than they in fact have. Usually, how you frame it determines how quickly another person can grok your question.

Even as simple as:

I am running Nginx (version number) on Ubuntu (version number) and am trying get the proper redirect status via the Nginx error_page config. In my nginx config file, I have:

error_page 404 /error.php;

I would expect it to return XXX but it instead returns YYY....

Just my opinion.... If it's a straight php question, you can usually just jump into the syntax in question.

2
  • Thanks :) - I tried update, see stackoverflow.com/revisions/30021456/6
    – Korvo
    Commented Jun 21, 2015 at 18:06
  • 1
    looks a lot better. A lot is just personal style so don't take anything I say as dogma. I ask a TON of questions and most are of beginner-intermediate variety in new (to me) technologies (currently iOS / Swift). I usually write out the technical part of the question first and then add an intro like 1-2 sentences to give the technical part context. I find that works well because somebody can know right away whether it is in their wheelhouse and also my level of sophistication. Also, the sights are really driven by questions so I feel ok asking a question even if it's possibly answered before.
    – timpone
    Commented Jun 22, 2015 at 6:00
5

In your question you have written "this is not working" which is never descriptive enough.

You should always try to accompany this along with either what it is doing instead, what errors it is giving, why the result is different to what you expect, a mix of any of these, or something along similar lines.

With all of the formatting you have put into your question, the actual question itself has become lost. It comes down to personal preference and opinion but...

  • I see no reason for the "fastcgi file" to be in bold
  • The note isn't quoting anything and may look better just being on its own line

Any time I find I am writing a lengthy question I like to leave a tl;dr (too long; didn't read) at the top just so users can determine whether it is worth their time continuing to read (can they answer it).

The most clear thing on your post should always be the actual question.


You may find that using the --- formatting will help you in distinguishing your question from additional (optional) information

2
  • I posted fastcgi_params file because of this review:stackoverflow.com/questions/30021456/… But I'm grateful for markup/formating tip.
    – Korvo
    Commented Jun 22, 2015 at 17:20
  • I don’t like TL;DR in questions (in answers they can be useful). If an answers contains "TL;DR" it is simply too long. I also don’t like lines in question as they do nothing than adding noise.
    – idmean
    Commented Jun 22, 2015 at 17:48
0

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

  1. Make question a little bit personalized, what problem you are facing?
  2. Get a background of the problem and what you have tried and what is not working.
  3. Give an a proper insight into the technologies you are using.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .