(to long for a comment, so I guess it's an answer)
I'm not sure what makes you assert there's a substantive difference between the two cases. When you use Mann-Whitney for testing location-shift alternatives, the assumption is of identical distributions aside from the possible location shift. It's not actually necessary to assume identical distributions. The Mann-Whitney, is, for example, perfectly appropriate for testing scale shift alternatives, or a host of other alternatives, as long as you can compute the distribution of the test statistic under the null. If your rank-based anova is to have a distribution you can compute under $H_0$, you'll need at least some assumptions for the null case there also.
If your assumptions for both are the same (such as both being applied to shift alternatives) and you compute the null distribution on an ANOVA for 2 groups of ranks correctly, your p-values will be identical to the equivalent two-tailed Mann-Whitney, in the same way that $t^2 = F$ for an ordinary 2 group ANOVA compared to a two-tailed two-sample-t (the version with equal-variance).
if I had two groups and both had different, non-normal distributions, but I only wanted to test for a difference in location what test would be preferable? I was under the impression I could use a t-test on ranks, or a Welch t-test on ranks. However, if these tests are the similar to a M_W U test then I guess this is not the case.
It's somewhat of a tricky question, because if they're different shapes 'location difference' doesn't have an obvious meaning in the way it does when they're the same shape.
If you define some measure of location difference (like difference in means or difference in medians or median of pairwise differences or difference in minimum or whatever) then you can do something with it - e.g. try to compute a resampling based distribution, like a bootstrap distribution. It's important to be clear about what you are prepared to assume though.
A Mann-Whitney can be used for more general alternatives than a simple location shift. e.g. For continuous distributions, you can write the null in the form:
$P(X>Y) = \frac{1}{2}$
and the alternative as
$P(X>Y) \neq \frac{1}{2}\quad$ (for a two tailed test)
or
$P(X>Y) < \frac{1}{2}\quad$ (or "$>$", in either case as a one tailed test)
If I recall correctly, Conover's Practical Nonparametric Statistics presents them this way, for example.
Does that mean they just test the same hypothesis/are useful in the same situations or are they are supposed to give the exact same p-values?
It means:
(i) the test statistics will be monotonic transformations of each other.
(ii) they give the same p-values, if you work out the p-values correctly.
Your problem is that the t-test on ranks doesn't have the distribution you use when you use t-tables (though in large samples they'll be close). You need to calculate its true distribution to correctly calculate the p-value. It matters most for small samples ... but they're also the ones where you can calculate the actual distribution most easily.
Best Answer
Report the result from the Mann Whitney test that is the appropriate test irrespective of whether or not the F test gives you the same result.