Forum Moderators: phranque

Message Too Old, No Replies

How can i direct this one?

         

mohs3n

7:55 am on Apr 9, 2011 (gmt 0)

10+ Year Member



Hi,

My website's login page is in the fist page (http://mydomain.com) and i need to only redirect the login page to "https" and the rest of the website must be non-ssl (http) .

I used this code in htaccess :

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) [mydomain...]

But it redirects all the pages to https .

Website URL is dynamic and i really have no idea how to direct only one page to https and redirect it back to http after login.

Before Login : [mydomain.com...]

After Login :
[mydomain.com...]

Is there any way to only direct the fist page to https and direct it back after login?

Thanks...

g1smd

7:05 pm on Apr 9, 2011 (gmt 0)

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



This question comes up several times per month and as such there are a number of prior posts with very detailed code examples.

You need TWO blocks of code. One forces https for the one URL, the other forces https for all other URLs.

Make sure that all links to stylesheets and images within your site use root-relative linking without protocol and domain name.

g1smd

7:11 am on Apr 10, 2011 (gmt 0)

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



TYPO:
You need TWO blocks of code. One forces https for the one URL, the other forces http for all other URLs.

mohs3n

8:22 pm on Apr 10, 2011 (gmt 0)

10+ Year Member



Could you please provide me these codes?, i couldnt find them in the forum.

wilderness

8:36 pm on Apr 10, 2011 (gmt 0)

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



https+rewrite [google.com]