I'm using web hosting with cPanel. Is it possible to setup 301 redirect from example.com to www.example.com? And if yes what are the steps?
First let me say welcome to the community!
It is definitely possible to setup a 301 redirect within a cPanel hosting plan. Most often this types of redirects are accomplished through scripting endeavors. I will admit that I'm not a scripting expert, but we do have an article Using 301 redirects that has some scripting examples to help you get started.
Perhaps one of our more knowledgeable members familiar with more scripting methods to accomplish this can also provide some more insight in this discussion for you or others to try out. Let us know what works best for you.