Hi all,<\/p>\n
A Newbie here…<\/p>\n
I’m trying to redirect users who go to http://webPage.example.com<\/a> to https://webPage.example.com<\/a><\/p>\n The site https://webPage.example.com<\/a> is working fine, I just can’t get the redirect to work. Here’s what I’ve tried.<\/p>\n To find the VirtualHost listing for https://webPage.example.com<\/a> I ran this:<\/p>\n apachectl -S | grep -i ‘webPage.example.com<\/a>’<\/p>\n With this result: *:443 webPage.example.com<\/a> (/etc/httpd/conf.d/ssl.conf:56)<\/p>\n So, I added this code to the end of the ssl.conf file:<\/p>\n <VirtualHost *:80> This did not work. My guess, the ssl.conf is not the correct .conf file to add the code. How do I find the correct VirtualHost listing. Or, what did I miss?<\/p>\n Thanks, for any help…<\/p>","upvoteCount":4,"answerCount":3,"datePublished":"2022-05-26T19:50:31.000Z","author":{"@type":"Person","name":"spiceuser-rnvh2","url":"https://community.spiceworks.com/u/spiceuser-rnvh2"},"suggestedAnswer":[{"@type":"Answer","text":" Hi all,<\/p>\n A Newbie here…<\/p>\n I’m trying to redirect users who go to http://webPage.example.com<\/a> to https://webPage.example.com<\/a><\/p>\n The site https://webPage.example.com<\/a> is working fine, I just can’t get the redirect to work. Here’s what I’ve tried.<\/p>\n To find the VirtualHost listing for https://webPage.example.com<\/a> I ran this:<\/p>\n apachectl -S | grep -i ‘webPage.example.com<\/a>’<\/p>\n With this result: *:443 webPage.example.com<\/a> (/etc/httpd/conf.d/ssl.conf:56)<\/p>\n So, I added this code to the end of the ssl.conf file:<\/p>\n <VirtualHost *:80> This did not work. My guess, the ssl.conf is not the correct .conf file to add the code. How do I find the correct VirtualHost listing. Or, what did I miss?<\/p>\n Thanks, for any help…<\/p>","upvoteCount":4,"datePublished":"2022-05-26T19:50:31.000Z","url":"https://community.spiceworks.com/t/http-redirect-to-https-not-working/833778/1","author":{"@type":"Person","name":"spiceuser-rnvh2","url":"https://community.spiceworks.com/u/spiceuser-rnvh2"}},{"@type":"Answer","text":" You can achieve this with a htaccess directive. Depending on your specific requirements have a look here:<\/p>\n
\nServerName webPage.example.com<\/a>
\nRedirect “/” \" https://webPage.example.com \"<\/a> ;
\n<\/p>\n
\nServerName webPage.example.com<\/a>
\nRedirect “/” \" https://webPage.example.com \"<\/a> ;
\n<\/p>\n