• cześć,

    mam problemy z ustawieniem przekierowania 301 w .htaccess na „z www”

    poniżej wklejam mój plik .htaccess

    próbowałem dodać do niego standardowe formułki:

    RewriteEngine On
    RewriteCond %{HTTP_HOST}//s%{HTTPS} ^([^www\.]{1}.*)//((s)on|s.*)$ [NC]
    RewriteRule ^ http%3://www.%1%{REQUEST_URI} [L,R=301]

    próbowałem z dodatkiem Simple 301 Redirects

    próbowałem ustawić przekierowanie w Direct Admin

    niestety dostaję taki błąd:
    The page isn’t redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    co zrobić???

    # BEGIN W3TC Browser Cache
    <IfModule mod_deflate.c>
        <IfModule mod_headers.c>
            Header append Vary User-Agent env=!dont-vary
        </IfModule>
            AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
        <IfModule mod_mime.c>
            # DEFLATE by extension
            AddOutputFilter DEFLATE js css htm html xml
        </IfModule>
    </IfModule>
    <FilesMatch "\.(css|htc|less|js|js2|js3|js4|CSS|HTC|LESS|JS|JS2|JS3|JS4)$">
        FileETag MTime Size
        <IfModule mod_headers.c>
            Header set Pragma "public"
            Header set Cache-Control "max-age=31536000, public"
             Header unset Set-Cookie
        </IfModule>
    </FilesMatch>
    <FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|XML)$">
        FileETag MTime Size
        <IfModule mod_headers.c>
            Header set Pragma "public"
            Header set Cache-Control "max-age=3600, public"
        </IfModule>
    </FilesMatch>
    <FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|woff|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|WAV|WMA|WRI|WOFF|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
        FileETag MTime Size
        <IfModule mod_headers.c>
            Header set Pragma "public"
            Header set Cache-Control "max-age=31536000, public"
             Header unset Set-Cookie
        </IfModule>
    </FilesMatch>
    # END W3TC Browser Cache
    # BEGIN W3TC Page Cache core
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        RewriteCond %{HTTP:Accept-Encoding} gzip
        RewriteRule .* - [E=W3TC_ENC:_gzip]
        RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
        RewriteRule .* - [E=W3TC_PREVIEW:_preview]
        RewriteCond %{REQUEST_METHOD} !=POST
        RewriteCond %{QUERY_STRING} =""
        RewriteCond %{REQUEST_URI} \/$
        RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
        RewriteCond %{HTTP_USER_AGENT} !(iPhone|iPod\ &\ Mobile|Android\ &\ Mobile|Opera\ &\ Mini/7|BB\ &\ Mobile\ Safari|BlackBerry\ &\ Mobile\ Safari|Firefox\ &\ Mobile|IEMobile/7\.0|IEMobile/8\.0|IEMobile/9\.0|IEMobile/10\ &\ Touch|IEMobile/11\ &\ Touch\ ) [NC]
        RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
        RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
    </IfModule>
    # END W3TC Page Cache core
    # 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]
    
       ExpiresActive on
    
        ExpiresByType image/jpg "access plus 1 month"
        ExpiresByType image/jpeg "access plus 1 month"
        ExpiresByType image/gif "access plus 1 month"
        ExpiresByType image/png "access plus 1 month"
    </IfModule>
    
    # END WordPress
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • Temat ‘Przekierowanie 301 bez www —> z www’ jest zamknięty na nowe odpowiedzi.