Tuesday, January 30, 2018

Sudomain automatically redirect to https - development

Sudomain automatically redirect to https

I’m having HTTPS with my main domain ie https://example.com.
And I want to use subdomain without HTTPS ie, http://hello.example.com but the problem is it automatically redirects to HTTPS. How do I avoid that?

This is my current .htaccess structure:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>



from Laravel Questions and Answers https://laravelquestions.com/php/sudomain-automatically-redirect-to-https/
via Lzo Media

No comments:

Post a Comment