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

I am using the redirect HTTP to HTTPS with /123/why-do-birds-sing (requires htaccess file) URL structure

The redirect work good with www (https://www.tshuva2sheela.com/) in Firefox and crhome. But the redirect does not work without www (https://tshuva2sheela.com/) in Firefox but work in chrome.

My htaccess file:

Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On

#RewriteBase /
RewriteRule ^(files)($|/) - [L]
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
 


RewriteCond %{HTTPS} off 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>

# BEGIN GZIP 
<ifmodule mod_deflate.c> 
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript 
</ifmodule> 
# END GZIP

Thank for the help and sorry for my English.

Q2A version: 1.8
closed with the note: resolved

1 Answer

0 votes
by
edited by

There was a problem with my SSL settings and the problem was resolved. This is my htaccess file which works without a problem (Gzip compression,  pretty url, SSL):


<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteRule ^(files)($|/) - [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>

# BEGIN GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# END GZIP

by
Thanks for share.
...