HTTP To HTTPS ????

ll-MegaMind-ll

Well-known member
  • May 13, 2011
    4,530
    699
    113
    Dharmayaiobai.org
    KOllane mage website akata https certificate akak damma, normally https:// gahuwama awlak nathuwa yanawa, but www. or http kiyala gahuwama normal load wenne. so http and www. gahuwama https://www. walata redirect karanne kohomada ? :eek:
     

    nismok

    Well-known member
  • Jun 27, 2008
    9,391
    673
    113
    Add 301 redirect to https using .httaccess or Apache config. (if you use Apache)
     

    ll-MegaMind-ll

    Well-known member
  • May 13, 2011
    4,530
    699
    113
    Dharmayaiobai.org
    ithin eka thamai
    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    onna oka daganin.

    nginx nam menna config eka
    server {
    listen 80;
    server_name site.com www.site.com;
    return 301 https://site.com$request_uri;
    }

    htaccess ake meka thiyanawa ban, mata me redirect aka one naha .. meka delete karala , uba deepu code aka dammama hariya ?

    RewriteEngine on
    DirectoryIndex index.html index.php index.htm parking-page.html
    RewriteCond %{HTTP_HOST} ^nikejerseyswholesaleshop\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.nikejerseyswholesaleshop\.com$
    RewriteRule ^/?$ "https\:\/\/www\.youtube\.com\/watch\?v\=QJRmQYT9VLs" [R=301,L]
     

    nismok

    Well-known member
  • Jun 27, 2008
    9,391
    673
    113
    yea i put the code, but its not working :/ , the htaccess file in the public_html right ?

    Yep. Are you sure mod_rewrite and .httaccess is enabled ?

    Remove others and add these.

    Code:
    RewriteEngine On
    Options +FollowSymLinks
    RewriteRule ^test\.html http://www.google.com/? [R=301,L]

    Goto http://domain.com/test.html (domain = your domain)

    Check whether it redirects to Google.com
     
    Last edited:

    ll-MegaMind-ll

    Well-known member
  • May 13, 2011
    4,530
    699
    113
    Dharmayaiobai.org
    Yep. Are you use mod_rewrite and .httaccess is enabled ?

    Remove others and add these.

    Code:
    RewriteEngine On
    Options +FollowSymLinks
    RewriteRule ^test\.html http://www.google.com/? [R=301,L]

    Goto http://domain.com/test.html (domain = your domain)

    Check whether it redirects to Google.com

    i dont know if the mod_rewrite and .httaccess is enabled, How do i check that ?