Rooting and growing pineapple tops is easy. Once you bring your pineapple home, cut off the leafy top about half an inch below the leaves. Then remove some of the lowest leaves. Trim off the outer portion of the pineapple top at the bottom of the crown, or stem, until you see root buds. These should resemble small, brown-colored bumps around the stem's perimeter.
Allow the pineapple top to dry for several days to one week prior to planting. This helps the top to heal, discouraging problems with rotting.
Although it's possible to sprout a pineapple in water, most people have better luck rooting them in soil. Use a light soil mix with perlite and sand. Place the pineapple top in the soil up to the base of its leaves. Water thoroughly and place it in bright, indirect light.
Keep it moist until roots develop. It should take about two months (6-8 weeks) for roots to establish. You can check for rooting by gently pulling the top to see the roots. Once significant root growth has occurred, you can start giving the plant additional light.
If desired, move the pineapple plant outdoors in a semi-shaded location throughout late spring and summer. However, be sure to move it back inside for overwintering.
Since pineapples are slow-growing plants, do not expect to see blooms for at least two to three years, if at all. It is possible, however, to encourage the flowering of mature pineapple plants.
Source: www.gardeningknowhow.com
You could also visit https://happydiyhome.com/how-to-grow-a-pineapple for additional information.