Forum Moderators: phranque

Message Too Old, No Replies

need help with .htaccess http>https>https

.htaccess http https

         

xeont

2:34 am on Sep 30, 2010 (gmt 0)

10+ Year Member



hi,
i want to know how to force https on URL like

[localhost...]

all other pages forces back to http

is it possible to do this using .htaccess?

thank you.

g1smd

6:54 am on Sep 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, and it's a topic that comes up every week.

There's several hundred threads with example code. All you'll need to do is substitute localhost for example.com.

There's two parts to the code, one that forces HTTP and one that forces HTTPS. However, it is important that you also link to the correct URL from within your site. The redirect is to correct old links found in search engine listings and so on.

One thing to check, do requests for HTTP and HTTPS resolve to the same folder on the server? That affects how you configure the code.