Demande de vérification htaccess et robot.txt

#780798
  • Resolved Moussa El hadj mimoune
    Rank Math free
    Content AI Starter

    Can you tell me if my htaccess and robot.txt file is correctly written, if there are no errors?
    Filehtaccess:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    </IfModule>
    Header always set Strict-Transport-Security max-age=31536000
    # BEGIN LSCACHE
    ## LITESPEED WP CACHE PLUGIN – Do not edit the contents of this block! ##
    <IfModule LiteSpeed>
    RewriteEngine on
    CacheLookup on
    RewriteRule .* – [E=Cache-Control:no-autoflush]
    RewriteRule\.litespeed_conf\.dat – [F,L]

    ### marker ASYNC start ###
    RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.php
    RewriteCond %{QUERY_STRING} action=async_litespeed
    RewriteRule .* – [E=noabort:1]
    ### marker ASYNC end ###

    ### marker MOBILE start ###
    RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
    RewriteRule .* – [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismobile]
    ### marker MOBILE end ###

    ### marker CACHE RESOURCE start ###
    RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php – [E=cache-control:max-age=3600]
    ### marker CACHE RESOURCE end ###

    ### marker FAVICON start ###
    RewriteRule favicon\.ico$ – [E=cache-control:max-age=86400]
    ### marker FAVICON end ###

    ### marker WEBP start ###
    RewriteCond %{HTTP_ACCEPT} “image/webp”
    RewriteRule .* – [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
    RewriteCond %{HTTP_USER_AGENT} iPhone.*Version/(\d{2}).*Safari
    RewriteCond %1 >13
    RewriteRule .* – [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
    ### marker WEBP end ###

    ### marker DROPQS start ###
    CacheKeyModify -qs:fbclid
    CacheKeyModify -qs:gclid
    CacheKeyModify -qs:utm*
    CacheKeyModify -qs:_ga
    ### marker DROPQS end ###

    </IfModule>
    ## LITESPEED WP CACHE PLUGIN – Do not edit the contents of this block! ##
    #END LSCACHE
    # BEGIN NON_LSCACHE
    ## LITESPEED WP CACHE PLUGIN – Do not edit the contents of this block! ##
    ### marker BROWSER CACHE start ###
    <IfModule mod_expires.c>
    ExpiresActivate on
    ExpiresByType application/pdf A31557600
    ExpiresByType image/x-icon A31557600
    ExpiresByType image/vnd.microsoft.icon A31557600
    ExpiresByType image/svg+xml A31557600

    ExpiresByType image/jpg A31557600
    ExpiresByType image/jpeg A31557600
    ExpiresByType image/png A31557600
    ExpiresByType image/gif A31557600
    ExpiresByType image/webp A31557600

    ExpiresByType video/ogg A31557600
    ExpiresByType audio/ogg A31557600
    ExpiresByType video/mp4 A31557600
    ExpiresByType video/webm A31557600

    ExpiresByType text/css A31557600
    ExpiresByType text/javascript A31557600
    ExpiresByType application/javascript A31557600
    ExpiresByType application/x-javascript A31557600

    ExpiresByType application/x-font-ttf A31557600
    ExpiresByType application/x-font-woff A31557600
    ExpiresByType application/font-woff A31557600
    ExpiresByType application/font-woff2 A31557600
    ExpiresByType application/vnd.ms-fontobject A31557600
    ExpiresByType font/ttf A31557600
    ExpiresByType font/otf A31557600
    ExpiresByType font/woff A31557600
    ExpiresByType font/woff2 A31557600

    </IfModule>
    ### marker BROWSER CACHE end ###

    ## LITESPEED WP CACHE PLUGIN – Do not edit the contents of this block! ##
    # END NON_LSCACHE
    # This file was updated by Duplicator on 2024-02-25 19:31:49.
    # See the original_files_ folder for the original source_site_htaccess file.
    # BEGINWordPress
    # Directives (lines) between “BEGIN WordPress” and “END WordPress” are generated
    # dynamically, and should only be modified via WordPress filters.
    # Any changes to directives between these markers will be overridden.
    <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

    robot.txt file:
    Disallow: *?s={search_term_string}

    Thanks in advance

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Thank you so much for getting in touch.

    Checking your htaccess configuration, overall, the file looks well-structured and contains common directives for HTTPS redirection, caching, and WordPress handling. However, we recommend getting a second and final opinion from your hosting provider as they are in the best position to review such server-related files.

    As for your robots.txt, it only shows the disallow directives while it doesn’t define what user-agent.

    Make sure the code sits below the user-agent like below:

    User-agent: *
    Disallow: *?s={search_term_string}

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Moussa El hadj mimoune
    Rank Math free
    Content AI Starter

    This way the robot.txt is good?

    File Robot.txt
    User-agent: *
    Disallow: *?s={search_term_string}

    Thanks in advance

    Hello,

    Our recommendation is that for most websites you use the default rules that are mentioned in our documentation here: https://rankmath.com/kb/how-to-edit-robots-txt-with-rank-math/#default-rules

    Then you can add any custom rules inside those such as the one you shared in your example.

    Don’t hesitate to get in touch if you have any other questions.

    Moussa El hadj mimoune
    Rank Math free
    Content AI Starter

    D’accord, donc ma versiona actuelle pour le site dev-web-agency et voildepudeur sont correcte ?
    dev-web-agency :
    User-agent: *
    Disallow: *?s={search_term_string}
    Sitemap: https://dev-web-agency.com/sitemap_index.xml

    voildepudeur
    User-agent: *
    Disallow: *?s={search_term_string}
    Sitemap: https://voiledepudeur.com/sitemap_index.xml

    Hello,

    Your robots.txt can be this way.

    1. dev-web-agency :

    User-Agent: *
    Disallow: /wp-admin/
    Disallow: *?s={search_term_string}
    Allow: /wp-admin/admin-ajax.php
    
    Sitemap: https://dev-web-agency.com/sitemap_index.xml

    2. voildepudeur :

    User-Agent: *
    Disallow: /wp-admin/
    Disallow: *?s={search_term_string}
    Allow: /wp-admin/admin-ajax.php
    
    Sitemap: https://voiledepudeur.com/sitemap_index.xml

    Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.

    Moussa El hadj mimoune
    Rank Math free
    Content AI Starter

    D’accord merci à vous

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on WordPress or TrustPilot about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Demande de vérification htaccess et robot.txt’ is closed to new replies.