The "rules of thumb" don't go very far for me. If you analyze your mortgage without reference to what you would otherwise spend in housing, the costs of commuting from the location, your sense of security in your income, your net worth, your expectations for relocation, your view on the local housing market etc. you're not making a wise decision.
Rules like 2.5 x salary, 26% of income tells you what bankers feel they can comfortably lend. They determine that based on patterns of default rates, current laws/regulations, and their own expectations about how long they are going to hold your lien and what market price they can get for it. Little to do with you really.
It's up to you to analyze your situation to know what you can comfortably afford. Given that buying a house is one of the biggest financial decisions people make, I think rules of thumb do more damage than good--both in limiting what people will consider (e.g., if you live in a location where housing prices mean you can't find something as little as 2.5x your income yet it would be a good deal to buy a house compared to the cost of renting) and buying too much (e.g., the house is less than 2.5x income but they haven't figured in job insecurity adequately).