"Por dos semanas" or "durante dos semanas"?

That's a good question!

Let's see the differences between these two options bit by bit:

Meaning

If you say "por una semana" and "durante una semana" both will be understood with the same meaning, as "por" is pretty common now.

Grammar difference

Por is a preposition and durante is too, so they're the same type of word.

What to use? The third option

The ideal is using EITHER durante, which is the only word that actually means "during" , OR NOTHING, which is maybe the most common:

Ex:

Estuve allí durante cuatro horas / Estuve allí dos horas

Conclusion:

If you can remember, use "durante" or nothing before saying the duration, cause it sounds better and it's the only one with evidence to support it, especially in formal writing.

Aaaand specially if you can still break the habit.

Lots of people with advanced level use "por" ,but as I said, I'd try to say "viajé durante dos semanas" or "viajé dos semanas" as much as possible.

Hope that helps!