If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Aug 2020
    Member #

    Is this HTACCESS code correct, and if not, how do I correct it?

    WORDPRESS : 5.4.2 / MY PHP : 7.4.8 / SERVER : APACHE / MYSQL : 5. 7. 28 / HOSTING : 1&1 IONOS (on sharing, mutual hosting) / PROTOCOLE SSL : ENABLE

    Hi everyone!
    I try to build my website for make social actions,I’m beginner in web development, i would like a people check my .htacces

    My domain look like i have redirection for people come in (I want keep this configuration for endpoint)

    I have replace my url website by : for privacy If you need my url website I can send it to you in a private message.


    [ code]
    # BEGIN WordPress
    # Les directives (lignes) entre 'BEGIN WordPress' et 'END WordPress' sont
    # généré dynamiquement, et ne doivent uniquement être modifiées via les filtres WordPress.
    # Toute modification des directives entre ces marqueurs sera outrepassée.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType image/svg "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType application/javascript "access 1 month"
    ExpiresByType application/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"

    # Make PHP code look like unknown types
    AddType application/x-httpd-php .bop .foo .133t
    <IfModule mod_rewrite.c>
    RewriteEngine on
    # HSTS preload
    RewriteCond %{HTTP_HOST} !^www\.[^.]+\.[^.]+$
    # Then redirect http to https (if necessary)
    RewriteCond %{HTTPS} on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]

    # BEGIN WP-Optimize Gzip compression
    <IfModule mod_filter.c>
    <IfModule mod_deflate.c>
    # Compress HTML, CSS, JavaScript, Text, XML and fonts
    AddType application/ .eot
    AddType font/ttf .ttf
    AddType font/otf .otf
    AddType font/x-woff .woff
    AddType image/svg+xml .svg
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/
    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-font-woff
    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 font/woff
    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
    # Remove browser bugs (only needed for really old browsers)
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    Header append Vary User-Agent
    # END WP-Optimize Gzip compression

    # BEGIN WP-Optimize Browser Cache
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access 28 days"
    ExpiresByType text/html "access 28 days"
    ExpiresByType image/gif "access 28 days"
    ExpiresByType image/png "access 28 days"
    ExpiresByType image/jpg "access 28 days"
    ExpiresByType image/jpeg "access 28 days"
    ExpiresByType image/webp "access 28 days"
    ExpiresByType image/x-icon "access 28 days"
    ExpiresByType application/pdf "access 28 days"
    ExpiresByType application/javascript "access 28 days"
    ExpiresByType text/x-javascript "access 28 days"
    ExpiresByType application/x-shockwave-flash "access 28 days"
    ExpiresDefault "access 28 days"

    <IfModule mod_headers.c>
    <filesMatch "\.(ico|jpe?g|png|gif|webp|swf)$">
    Header set Cache-Control "public"

    <filesMatch "\.(css)$">
    Header set Cache-Control "public"

    <filesMatch "\.(js)$">
    Header set Cache-Control "private"

    <filesMatch "\.(x?html?|php)$">
    Header set Cache-Control "private, must-revalidate"

    #Disable ETag
    FileETag None
    # END WP-Optimize Browser

    # Wordfence WAF
    <Files ".user.ini">
    <IfModule mod_authz_core.c>
    Require all denied

    <IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
    # END Wordfence WAF


    Thank so much for your help
    Wishing you a good day.


  3. #2
    Member Cutler's Avatar
    Join Date
    Feb 2021
    Member #
    7 times
    You aren't that much of a beginner if you are messing around with .htaccess.

    There is a lot here, is there something specific you are having issues with?
    $1/year Portfolio Hosting with Promo Code: WEBDESIGNFORUMS

    Agency: Marshalled Makers
    Hosting: Marshalled Makers Hosting

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Tags for this Thread

All times are GMT -6. The time now is 07:04 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: