• Resolved burakkkse

    (@burakkkse)


    Hello everyone.
    First i searched and looked so many topics about this issue but still not be able to solve problem.

    In my cookies there are two kind of cookie. Also google search console has two kind of domain(www and non www).
    My wordpress general settings are set to https://www.yerkureemlak.com
    In my .htaccess file it is set to www…

    But when i write yerkureemlak.com it doesnt redirect to https://www.yerkureemlak.com

    Additional info: I use really simple ssl and 301 redirect was open but now i closed and opened htaccess redirect.

    I use wp fastest cache plugin and i dont know if it is about this issue.
    Below my .htaccess file

    # BEGIN WpFastestCache
    # Modified Time: 10-09-21 12:49:55
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} =on
    RewriteCond %{HTTP_HOST} ^www.yerkureemlak.com
    # Start WPFC Exclude
    # End WPFC Exclude
    # Start_WPFC_Exclude_Admin_Cookie
    RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=burakkkse|farrukh
    # End_WPFC_Exclude_Admin_Cookie
    RewriteCond %{HTTP_HOST} ^www.yerkureemlak.com
    RewriteCond %{HTTP_USER_AGENT} !(facebookexternalhit|WP_FASTEST_CACHE_CSS_VALIDATOR|Twitterbot|LinkedInBot|WhatsApp|Mediatoolkitbot)
    RewriteCond %{HTTP_USER_AGENT} !(WP\sFastest\sCache\sPreload(\siPhone\sMobile)?\s*Bot)
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{REQUEST_URI} !(\/){2}$
    RewriteCond %{REQUEST_URI} \/$
    RewriteCond %{QUERY_STRING} !.+
    RewriteCond %{HTTP:Cookie} !wordpress_logged_in
    RewriteCond %{HTTP:Cookie} !comment_author_
    RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP_USER_AGENT} !^.*(\bCrMo\b|CriOS|Android.*Chrome\/[.0-9]*\s(Mobile)?|\bDolfin\b|Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\/[0-9.]+|Coast\/[0-9.]+|Skyfire|Mobile\sSafari\/[.0-9]*\sEdge|IEMobile|MSIEMobile|fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS|bolt|teashark|Blazer|Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari|Tizen|UC.*Browser|UCWEB|baiduboxapp|baidubrowser|DiigoBrowser|Puffin|\bMercury\b|Obigo|NF-Browser|NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger|Android.*PaleMoon|Mobile.*PaleMoon|Android|blackberry|\bBB10\b|rim\stablet\sos|PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino|Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\bS60\b|Windows\sCE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window\sMobile|Windows\sPhone\s[0-9.]+|WCE;|Windows\sPhone\s10.0|Windows\sPhone\s8.1|Windows\sPhone\s8.0|Windows\sPhone\sOS|XBLWP7|ZuneWP7|Windows\sNT\s6\.[23]\;\sARM\;|\biPhone.*Mobile|\biPod|\biPad|Apple-iPhone7C2|MeeGo|Maemo|J2ME\/|\bMIDP\b|\bCLDC\b|webOS|hpwOS|\bBada\b|BREW).*$ [NC]
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or]
    RewriteCond /home/u0273670/public_html/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 x-font/ttf
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot font/otf
    </IfModule>
    # END GzipWpFastestCache
    # ----------------------------------------------------------------------
    # CORS-enabled images / fonts and other stuff (@crossorigin)
    # ----------------------------------------------------------------------
    <IfModule mod_setenvif.c>
      <IfModule mod_headers.c>
        # mod_headers, y u no match by Content-Type?!
        <FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$">
          SetEnvIf Origin ":" IS_CORS
          Header set Access-Control-Allow-Origin "*" env=IS_CORS
        </FilesMatch>
      </IfModule>
    </IfModule>
    # ----------------------------------------------------------------------
    # Webfont access
    # ----------------------------------------------------------------------
    <IfModule mod_headers.c>
      <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
        Header set Access-Control-Allow-Origin "*"
      </FilesMatch>
    </IfModule>
    # BEGIN LBCWpFastestCache
    <FilesMatch "\.(webm|ogg|mp4|ico|pdf|flv|avif|jpg|jpeg|png|gif|webp|js|css|swf|x-html|css|xml|js|woff|woff2|otf|ttf|svg|eot)(\.gz)?$">
    <IfModule mod_expires.c>
    AddType application/font-woff2 .woff2
    AddType application/x-font-opentype .otf
    ExpiresActive On
    ExpiresDefault A0
    ExpiresByType video/webm A10368000
    ExpiresByType video/ogg A10368000
    ExpiresByType video/mp4 A10368000
    ExpiresByType image/avif A10368000
    ExpiresByType image/webp A10368000
    ExpiresByType image/gif A10368000
    ExpiresByType image/png A10368000
    ExpiresByType image/jpg A10368000
    ExpiresByType image/jpeg A10368000
    ExpiresByType image/ico A10368000
    ExpiresByType image/svg+xml A10368000
    ExpiresByType text/css A10368000
    ExpiresByType text/javascript A10368000
    ExpiresByType application/javascript A10368000
    ExpiresByType application/x-javascript A10368000
    ExpiresByType application/font-woff2 A10368000
    ExpiresByType application/x-font-opentype A10368000
    ExpiresByType application/x-font-truetype A10368000
    </IfModule>
    <IfModule mod_headers.c>
    Header set Expires "max-age=A10368000, public"
    Header unset ETag
    Header set Connection keep-alive
    FileETag None
    </IfModule>
    </FilesMatch>
    # END LBCWpFastestCache
    
    # BEGIN rlrssslReallySimpleSSL rsssl_version[5.0.10]
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteCond %{REQUEST_URI} !wp-content\/cache\/(all|wpfc-mobile-cache)
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
    </IfModule>
    # END rlrssslReallySimpleSSL
    # BEGIN WordPress
    # "BEGIN WordPress" ve "END WordPress" aras?ndaki y?nergeler (sat?rlar)
    # dinamik olarak olu?turulmu?tur ve sadece WordPress süzge?leri ile düzenlenmelidir.
    # Bu i?aretler aras?ndaki y?nergelerde yap?lan de?i?iklikler üzerine yaz?lacakt?r.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • You can achieved this by putting this code in your .htaccess file

    RewriteCond %{HTTP_HOST} !^www\.
    RewriteCond %{HTTPS}s on(s)|offs()
    RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R]
     
    Thread Starter burakkkse

    (@burakkkse)

    Should i replace with some other codes or just add to anywhere?

    you can replace or put this code below all your code

    Thread Starter burakkkse

    (@burakkkse)

    You are awesome dude… Why i couldnt find this. Thanks so much…

    • This reply was modified 3 years, 2 months ago by burakkkse.
    Thread Starter burakkkse

    (@burakkkse)

    but now i cant login admin panel :/
    When i add code everything is ok super fast and www redirect working but cant login. Delete again and slow but can login admin panel

    and this..
    ERR_TOO_MANY_REDIRECTS

    • This reply was modified 3 years, 2 months ago by burakkkse.
    Thread Starter burakkkse

    (@burakkkse)

    Btw i added a rule on cpanel and i noticed that
    in htaccess file the code below added automatically. But this code is not in <ifmodule>

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

    Finally i can get some sleep ??

    so, it has been fixed now?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Redirect non-www to www’ is closed to new replies.