We study the boundedness of the maximal operator in the weighted spacesLp(⋅)(ρ)over a bounded open setΩin the Euclidean spaceℝnor a Carleson curveΓin a complex plane. The weight function may belong to a certain version of a general Muckenhoupt-type condition, which is narrower than the expected Muckenhoupt condition for variable exponent, but coincides with the usual Muckenhoupt classApin the case of constantp. In the case of Carleson curves there is also considered another class of weights of radial type of the formρ(t)=∏k=1mwk(|t-tk|),tk∈Γ, wherewkhas the property thatr1p(tk)wk(r)∈Φ10, whereΦ10is a certain Zygmund-Bari-Stechkin-type class. It is assumed that the exponentp(t)satisfies the Dini–Lipschitz condition. For such radial type weights the final statement on the boundedness is given in terms of the index numbers of the functionswk(similar in a sense to the Boyd indices for the Young functions defining Orlich spaces).