New here? Register and read our Community Rules. Accounts are approved by hand.

https redirection

I have a ssl certificate installed for a domain

and I have forced the domain with https

so it gets forced to https:// whenever browsed in https://

However there is a sub folder mydomain.com/subfolder

which I want to go back to http:// how can I achieve this please kindly help

Thank you in advance.

Comments

  • How have you forced it to use HTTPS? Also, why do you need that sub-folder to not have HTTPS?

  • Because it contains an application that doesn't support https properly and the layout everything breaks..

    I have only used the following code

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://mydomain.com/$1 [R=301,L]

  • Hello..

    Create a file called .htaccess and you need to enter this code:


    RewriteEngine On

    RewriteCond %{SERVER_PORT} 80

    RewriteRule ^(.*)$ https://mydomain.com/$1 [R,L]


    Hope that helps.

  • @kamal said:
    Because it contains an application that doesn't support https properly and the layout everything breaks..

    I have only used the following code

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://mydomain.com/$1 [R=301,L]

    Try:
    RewriteRule ^(subfolder)($|/) - [L]

  • @WickedGamingUK said:
    RewriteRule ^(subfolder)($|/) - [L]

    The code I gave him works, so don't worry.

  • kamalkamal Member
    edited November 2014

    Sir Thank you for the help.

    That will produce a redirect loop

    I have the following code

    RewriteEngine On

    RewriteCond %{SERVER_PORT} 80

    RewriteRule ^(subdirectory)($|/) - [L]

    RewriteRule ^(.*)$ https://mydomain.com/$1 [R=301,L]

    Thank you

  • @kamal said:
    Sir Thank you for the help.

    That will produce a redirect loop

    I have the following code

    RewriteEngine On

    RewriteCond %{SERVER_PORT} 80

    RewriteRule ^(subdirectory)($|/) - [L]

    RewriteRule ^(.*)$ https://mydomain.com/$1 [R=301,L]

    Thank you

    Try it in this orientation:
    RewriteEngine On
    RewriteRule ^(subdirectory)($|/) - [L]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://mydomain.com/$1 [R=301,L]

  • Sir,

    Thank you it's working now

    Also how can I avoid subdirectory/subdirectory from being forced with https..

Sign In or Register to comment.