• Hi,

    All 4 versions of my website domain name redirect well to https://www

    4 versions:

    [ Multiple links deleted ]

    However pages don’t if they start with https:// or https://www
    They should redirect to https://www as well.

    Examples:

    [ Also deleted ]

    I don’t use redirect plugins, just .htaccess file. Can you tell me how to fix this please? My .htaccess file is below.

    Thanks

    # BEGIN WpFastestCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^example\.com
    RewriteRule ^(.*)$ http\:\/\/www\.example\.net\/$1 [R=301,L]
    # Start WPFC Exclude
    # End WPFC Exclude
    # Start_WPFC_Exclude_Admin_Cookie
    RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=jcksrl
    # End_WPFC_Exclude_Admin_Cookie
    RewriteCond %{HTTP_HOST} ^exanple\.net
    RewriteCond %{HTTP_USER_AGENT} !(facebookexternalhit|WhatsApp|Mediatoolkitbot)
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{HTTPS} !=on
    RewriteCond %{REQUEST_URI} !(\/){2}$
    RewriteCond %{REQUEST_URI} \/$
    RewriteCond %{QUERY_STRING} !.+
    RewriteCond %{HTTP:Cookie} !wordpress_logged_in
    RewriteCond %{HTTP:Cookie} !comment_author_
    RewriteCond %{HTTP:Cookie} !wp_woocommerce_session
    RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or]
    RewriteCond /home3/santu2qw/public_html/example.net/wp-content/cache/all/$1/index.html -f
    RewriteRule ^(.*) "/wp-content/cache/all/$1/index.html" [L]
    </IfModule>
    <FilesMatch "index\.(html|htm)$">
    AddDefaultCharset UTF-8
    <ifModule mod_headers.c>
    FileETag None
    Header unset ETag
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Mon, 29 Oct 1923 20:30:00 GMT"
    </ifModule>
    </FilesMatch>
    # END WpFastestCache
    # BEGIN GzipWpFastestCache
    <IfModule mod_deflate.c>
    AddType x-font/woff .woff
    AddType x-font/ttf .ttf
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot font/otf
    </IfModule>
    # END GzipWpFastestCache
    # BEGIN LBCWpFastestCache
    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|webp|js|css|swf|x-html|css|xml|js|woff|woff2|ttf|svg|eot)(\.gz)?$">
    <IfModule mod_expires.c>
    AddType application/font-woff2 .woff2
    ExpiresActive On
    ExpiresDefault A0
    ExpiresByType image/webp A2592000
    ExpiresByType image/gif A2592000
    ExpiresByType image/png A2592000
    ExpiresByType image/jpg A2592000
    ExpiresByType image/jpeg A2592000
    ExpiresByType image/ico A2592000
    ExpiresByType image/svg+xml A2592000
    ExpiresByType text/css A2592000
    ExpiresByType text/javascript A2592000
    ExpiresByType application/javascript A2592000
    ExpiresByType application/x-javascript A2592000
    ExpiresByType application/font-woff2 A2592000
    </IfModule>
    <IfModule mod_headers.c>
    Header set Expires "max-age=2592000, public"
    Header unset ETag
    Header set Connection keep-alive
    FileETag None
    </IfModule>
    </FilesMatch>
    # END LBCWpFastestCache
    RewriteOptions inherit
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    # compress text, html, javascript, css, xml:
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
     
    # Or, compress certain file types by extension:
     
    <files *.html>
    SetOutputFilter DEFLATE
    </files>
    • This topic was modified 5 years, 5 months ago by Jack Sarlo.
    • This topic was modified 5 years, 5 months ago by Jack Sarlo.
    • This topic was modified 5 years, 5 months ago by Jack Sarlo.
    • This topic was modified 5 years, 5 months ago by Jack Sarlo.
    • This topic was modified 5 years, 5 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @redhalls When you post that many links like that, you blow out our spam filter. Because that looks AMAZINGLY spammy. That is not necessary, don’t repeat that please, OK?

    *Drinks coffee*

    WordPress does not do multiple sites using the WordPress installation. It breaks many things. Have one version of your site only and 301 all the rest to the real website. Put that above all other .htaccess rules like so.

    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example\.com [NC,OR]
    RewriteCond %{HTTP_HOST} ^www.example\.com [NC]
    RewriteRule ^(.*)$ https://example\.net/$1 [L,R=301,NC]
    </ifModule>
    

    Replace example\.com with the old other sites. Replace example\.net with the real site you want to keep.

    • This reply was modified 5 years, 5 months ago by Jan Dembowski. Reason: Fixed typo
    Thread Starter Jack Sarlo

    (@redhalls)

    Hi,

    Not sure I understand you well, because it did not work.

    These still don’t redirect to https version, if I include a page after the .com e.g. /askjack/

    https://www.
    https://

    This is the new .htaccess file.

    # BEGIN WpFastestCache
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^informationmarketingexpert\.com [NC,OR]
    RewriteCond %{HTTP_HOST} ^www.informationmarketingexpert\.com [NC]
    RewriteRule ^(.*)$ https://informationmarketingexpert\.net/$1 [L,R=301,NC]
    # Start WPFC Exclude
    # End WPFC Exclude
    # Start_WPFC_Exclude_Admin_Cookie
    RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=jcksrl
    # End_WPFC_Exclude_Admin_Cookie
    RewriteCond %{HTTP_HOST} ^www.informationmarketingexpert.com
    RewriteCond %{HTTP_USER_AGENT} !(facebookexternalhit|WhatsApp|Mediatoolkitbot)
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{HTTPS} !=on
    RewriteCond %{REQUEST_URI} !(\/){2}$
    RewriteCond %{REQUEST_URI} \/$
    RewriteCond %{QUERY_STRING} !.+
    RewriteCond %{HTTP:Cookie} !wordpress_logged_in
    RewriteCond %{HTTP:Cookie} !comment_author_
    RewriteCond %{HTTP:Cookie} !wp_woocommerce_session
    RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or]
    RewriteCond /home3/santu2qw/public_html/informationmarketingexpert.com/wp-content/cache/all/$1/index.html -f
    RewriteRule ^(.*) "/wp-content/cache/all/$1/index.html" [L]
    </IfModule>
    <FilesMatch "index\.(html|htm)$">
    AddDefaultCharset UTF-8
    <ifModule mod_headers.c>
    FileETag None
    Header unset ETag
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Mon, 29 Oct 1923 20:30:00 GMT"
    </ifModule>
    </FilesMatch>
    # END WpFastestCache
    # BEGIN GzipWpFastestCache
    <IfModule mod_deflate.c>
    AddType x-font/woff .woff
    AddType x-font/ttf .ttf
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot font/otf
    </IfModule>
    # END GzipWpFastestCache
    # BEGIN LBCWpFastestCache
    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|webp|js|css|swf|x-html|css|xml|js|woff|woff2|ttf|svg|eot)(\.gz)?$">
    <IfModule mod_expires.c>
    AddType application/font-woff2 .woff2
    ExpiresActive On
    ExpiresDefault A0
    ExpiresByType image/webp A2592000
    ExpiresByType image/gif A2592000
    ExpiresByType image/png A2592000
    ExpiresByType image/jpg A2592000
    ExpiresByType image/jpeg A2592000
    ExpiresByType image/ico A2592000
    ExpiresByType image/svg+xml A2592000
    ExpiresByType text/css A2592000
    ExpiresByType text/javascript A2592000
    ExpiresByType application/javascript A2592000
    ExpiresByType application/x-javascript A2592000
    ExpiresByType application/font-woff2 A2592000
    </IfModule>
    <IfModule mod_headers.c>
    Header set Expires "max-age=2592000, public"
    Header unset ETag
    Header set Connection keep-alive
    FileETag None
    </IfModule>
    </FilesMatch>
    # END LBCWpFastestCache
    RewriteOptions inherit
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    # compress text, html, javascript, css, xml:
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
     
    # Or, compress certain file types by extension:
     
    <files *.html>
    SetOutputFilter DEFLATE
    </files>
    • This reply was modified 5 years, 5 months ago by Jack Sarlo.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirecting to ‘https://www’ version’ is closed to new replies.