Braneworld solutions for modified theories of gravity with nonconstant curvature