Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
1.5k views
in Q2A Core by

How correctly to edit https:// in .htaccess

Options -Indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>

Q2A version: 1.7.5
by
How to properly configure the output in .htaccess http://site.com I do not want it to be http://www.site.com

How to delete WWW for url

3 Answers

+1 vote
by
by
does not work
+2 votes
by

1) in .htaccess

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://yourdomain.com/$1  [R,L]

RewriteCond %{HTTP_HOST} ^www\.yourdomain.com\.com$
RewriteRule ^/?$ "https\:\/\/yourdomain.com\.com\/" [R=301,L]

</IfModule>

2) Go to admin -> General

for site url type https://yourdomain.com/

by
When switching to categories and questions, error 404 appears
by
check your theme files and qa-theme-base.php file search for http://  change them to https://
by
In this case, everything works. Is there no excess here?

Options -Indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://site.com/$1  [R,L]
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^/?$ "https\:\/\/site.com\.com\/" [R=301,L]
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>
0 votes
by


<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://domain.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>
change your domain name instead of domain
https://ajawbk.com
...