redirect http to https in apache

i read thru a few article how to do it, but i could not get it to work the way i want it.

vi ../httpd.conf
Redirect permanent /dev https://servername/portal/

when i type servername, works fine.

my goal is to type dev, and it takes me to https://servername/portal/

This is really a question more suited for the Web Programming forum, imho.

And to make sure I understand your question: do you want to be able to type "dev" in your browser's address bar and be automatically redirected to https://servername/portal?

correct. type dev in the browser, and takes me to https://servername/portal

That sounds more like something your browser would deal with, than a web server would, if "/dev" is exactly all what you propose typing into the address bar.

If you meant (i.e.) http://localhost/dev , then you could certainly use a ReWrite rule to get to the address you want.

let me rephrase, my need again. currently, i type https://servername/lawsongeek/portal, works fine. my goal is:
if i type https://servername or https://servername/lawsongeek, it should take me to https://servername/lawsongeek/portal