Redirect from http to https without www using .htaccess

Undisputed Shadow

I have application based on PHP and Apache. If requested link is not directory or file, all requests go to index.php file. I wanna redirect all requests from http to https and without www.

Valid link for me:

  1. https://someaddress.org

Started from following links invalid for me(sorry my reputation is very small and i cant post more 2 links):

  1. http://
  2. http://www.
  3. www.

My htaccess looks like that

AddDefaultCharset UTF-8

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [L]

How i can do redirects to https and without www?

anubhava

Have another rule for http->http and www removal:

AddDefaultCharset UTF-8

RewriteEngine on
RewriteBase /

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://someaddress.org%{REQUEST_URI} [L,NE,R=301]

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

.htaccess http www or non www redirect to https

From Dev

Redirect Domain1 to HTTP non-www to HTTPS www - Domain2 without HTTPS htaccess

From Dev

Redirect all non-www, www, http:// requests to https://www. using .htaccess file

From Dev

htaccess http to https redirect for www & sub domain

From Dev

Redirect HTTP to HTTPS using htaccess?

From Dev

Redirect all website link www to non www and http to https using .htaccess

From Dev

How to redirect HTTPS non-www to HTTPS www using .htaccess?

From Java

htaccess redirect to https://www

From Dev

Redirect all non-www to www for both http and https with .htaccess

From Dev

htaccess redirect domain to https, subdomain to http and www to non-www

From Dev

http to https redirect along with www to non-www in htaccess

From Dev

Doing a redirect from naked http & https domain to https://www domain in htaccess?

From Dev

htaccess to redirect http:// and http://www to https:// that plays nice with subdomains

From Dev

.htaccess Subfolder Redirect from http:// to www

From Dev

how to redirect www and non www to https for specific domain using htaccess

From Dev

how to redirect www and non www to https for specific domain using htaccess

From Dev

http://www redirect to https://

From Dev

http to https redirect with subdomains and www conversion via htaccess

From Dev

Redirect non WWW to WWW using htaccess without failing subdomains

From Dev

Redirect https to http using htaccess in opencart

From Dev

Using htaccess to redirect http to https for Wordpress?

From Dev

Redirect https to http using htaccess in opencart

From Dev

Use htaccess to redirect users from http to https

From Dev

Use htaccess to redirect users from http to https

From Dev

htaccess redirect to "https://www."

From Dev

HTACCESS add WWW with HTTPS redirect

From Dev

htaccess redirect to "https://www."

From Dev

Htaccess - Rewrite from http to https and www to non-www

From Dev

Redirect www. to non-www and redirect all http to https with .htaccess

Related Related

  1. 1

    .htaccess http www or non www redirect to https

  2. 2

    Redirect Domain1 to HTTP non-www to HTTPS www - Domain2 without HTTPS htaccess

  3. 3

    Redirect all non-www, www, http:// requests to https://www. using .htaccess file

  4. 4

    htaccess http to https redirect for www & sub domain

  5. 5

    Redirect HTTP to HTTPS using htaccess?

  6. 6

    Redirect all website link www to non www and http to https using .htaccess

  7. 7

    How to redirect HTTPS non-www to HTTPS www using .htaccess?

  8. 8

    htaccess redirect to https://www

  9. 9

    Redirect all non-www to www for both http and https with .htaccess

  10. 10

    htaccess redirect domain to https, subdomain to http and www to non-www

  11. 11

    http to https redirect along with www to non-www in htaccess

  12. 12

    Doing a redirect from naked http & https domain to https://www domain in htaccess?

  13. 13

    htaccess to redirect http:// and http://www to https:// that plays nice with subdomains

  14. 14

    .htaccess Subfolder Redirect from http:// to www

  15. 15

    how to redirect www and non www to https for specific domain using htaccess

  16. 16

    how to redirect www and non www to https for specific domain using htaccess

  17. 17

    http://www redirect to https://

  18. 18

    http to https redirect with subdomains and www conversion via htaccess

  19. 19

    Redirect non WWW to WWW using htaccess without failing subdomains

  20. 20

    Redirect https to http using htaccess in opencart

  21. 21

    Using htaccess to redirect http to https for Wordpress?

  22. 22

    Redirect https to http using htaccess in opencart

  23. 23

    Use htaccess to redirect users from http to https

  24. 24

    Use htaccess to redirect users from http to https

  25. 25

    htaccess redirect to "https://www."

  26. 26

    HTACCESS add WWW with HTTPS redirect

  27. 27

    htaccess redirect to "https://www."

  28. 28

    Htaccess - Rewrite from http to https and www to non-www

  29. 29

    Redirect www. to non-www and redirect all http to https with .htaccess

HotTag

Archive