Avoid landing page redirects error
Hi Gurus,
I am in trouble, I successfully got the 301 done but now it gives 2 redirections at landing page as follows;
Example issue:
If I type example.com in Google webpage speed test, now it is giving me errors;
PLease note I have SSL installed and working, I have lot of subdomains (each country one) but in below example I included only for sample, Can any one tell what did I do wrong below;
Avoid landing page redirects for the following chain of redirected URLs.
http://example.com/
https://example.com/
https://www.example.com/
PLease note I have SSL installed and working, I have lot of subdomains (each country one) but in below example I included only for sample, Can any one tell what did I do wrong below;
#Force non-www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.af.example\.com [NC]
RewriteRule ^(.*)$ [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.al.example\.com [NC]
RewriteCond %{HTTP_HOST} ^www\.zm.example\.com [NC]
RewriteRule ^(.*)$ [L,R=301]
## Server Defaults
ServerSignature Off
DefaultLanguage en-US
AddDefaultCharset utf-8
## Index Preferences
Options All -Indexes
IndexIgnore *
## GZIP Compression
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
## EXPIRES CACHING ##
ExpiresActive On
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
Header set Cache-Control "max-age=2628000, public"
## Set Default PHP version
#AddHandler application/x-httpd-php56 .php
#AddHandler application/x-httpd-php70 .php
Header always set Access-Control-Allow-Origin "*"
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) Please sign in to leave a comment.
Comments
0 comments