Skip to content

Commit

Permalink
Update plugins & add a example htaccess with common headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thulin committed Jan 26, 2024
1 parent fc85a77 commit 7b7e5d7
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 11 deletions.
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@
"helsingborg-stad/api-alarm-integration": "~3.0.4",
"helsingborg-stad/api-event-manager-integration": "~1.2.6",
"helsingborg-stad/api-project-manager-integration": "~2.0.2",
"helsingborg-stad/api-volunteer-manager-integration": "~2.2.18",
"helsingborg-stad/api-volunteer-manager-integration": "~2.2.19",
"helsingborg-stad/attachment-revisions": "~3.0.4",
"helsingborg-stad/better-post-ui": "~3.0.3",
"helsingborg-stad/broken-link-detector": "~3.0.3",
"helsingborg-stad/component-library": "~3.13.1",
"helsingborg-stad/component-library": "~3.13.5",
"helsingborg-stad/content-scheduler": "~3.0.5",
"helsingborg-stad/custom-short-links": "~3.0.4",
"helsingborg-stad/customer-feedback": "~4.0.5",
"helsingborg-stad/customer-feedback": "~4.0.6",
"helsingborg-stad/easy-to-read-alternative": "~3.0.3",
"helsingborg-stad/force-ssl": "~3.0.2",
"helsingborg-stad/gdi-modularity-cases": "~1.0.3",
Expand All @@ -65,23 +65,23 @@
"helsingborg-stad/lix-calculator": "~4.0.2",
"helsingborg-stad/media-usage": "~3.0.4",
"helsingborg-stad/mod-my-pages": "~1.0.3",
"helsingborg-stad/modularity": "~5.20.5",
"helsingborg-stad/modularity": "~5.21.3",
"helsingborg-stad/modularity-contact-banner": "~3.1.0",
"helsingborg-stad/modularity-entryscape": "~3.0.3",
"helsingborg-stad/modularity-form-builder": "~3.0.4",
"helsingborg-stad/modularity-form-builder": "~3.1.2",
"helsingborg-stad/modularity-guides": "~4.0.2",
"helsingborg-stad/modularity-interactive-img-map": "~4.0.2",
"helsingborg-stad/modularity-json-render": "~3.0.2",
"helsingborg-stad/modularity-local-events": "~3.1.0",
"helsingborg-stad/modularity-open-street-map": "~1.1.0",
"helsingborg-stad/modularity-open-street-map": "~1.1.2",
"helsingborg-stad/modularity-products": "~2.0.2",
"helsingborg-stad/modularity-recommend": "~2.0.2",
"helsingborg-stad/modularity-sections": "~3.0.2",
"helsingborg-stad/modularity-testimonials": "~3.0.2",
"helsingborg-stad/modularity-timeline": "~3.0.2",
"helsingborg-stad/multi-network-urls": "~2.0.0",
"helsingborg-stad/multisite-role-propagation": "~3.0.3",
"helsingborg-stad/municipio": "~3.61.8",
"helsingborg-stad/municipio": "~3.61.15",
"helsingborg-stad/redirection-extended": "~3.0.3",
"helsingborg-stad/s3-uploads-custom-endpoint": "~2.0.0",
"helsingborg-stad/search-notices": "~3.0.2",
Expand Down Expand Up @@ -110,20 +110,20 @@
"true/punycode": "^2.1.1",
"wikimedia/composer-merge-plugin": "dev-master",
"wpackagist-plugin/autodescription": "~4.2.8",
"wpackagist-plugin/cookies-and-content-security-policy": "~2.17",
"wpackagist-plugin/cookies-and-content-security-policy": "~2.20",
"wpackagist-plugin/fakerpress": "~0.6.2",
"wpackagist-plugin/kirki": "~5.0",
"wpackagist-plugin/litespeed-cache": "~5.6",
"wpackagist-plugin/network-plugin-auditor": "~1.10.1",
"wpackagist-plugin/nginx-helper": "^2.2.3",
"wpackagist-plugin/performant-translations": "~1.0.5",
"wpackagist-plugin/nginx-helper": "^2.2.4",
"wpackagist-plugin/performant-translations": "~1.0.9",
"wpackagist-plugin/redirection": "~5.4.1",
"wpackagist-plugin/redis-cache": "2.5.0",
"wpackagist-plugin/simple-smtp": "~1.3.3",
"wpackagist-plugin/stream":"~3.10.0",
"wpackagist-plugin/user-switching": "~1.7.2",
"wpackagist-plugin/username-changer": "~3.2.2",
"wpackagist-plugin/varnish-http-purge": "~5.2.0",
"wpackagist-plugin/varnish-http-purge": "~5.2.1",
"wpackagist-plugin/wp-multi-network": "~2.5.2",
"wpackagist-plugin/wp-nested-pages": "~3.2.4",
"wpackagist-plugin/wp-sentry-integration": "^6.26",
Expand Down
132 changes: 132 additions & 0 deletions config-example/htaccess-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# BEGIN HSTS
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=7889232"
</IfModule>
# END HSTS

# BEGIN Remove WWW
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
</IfModule>
# END Remove WWW

# BEGIN XMLRPC-Block
<FilesMatch "^(xmlrpc\.php|wp-trackback\.php)">
Order Deny,Allow
Deny from all
</FilesMatch>
# END XMLRPC-Block

# BEGIN Remove author pages
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} ^author=([0-9]){1,}$ [NC]
RewriteRule ^(.*)$ $1?author=999999 [L]
</ifModule>
# END Remove author pages

# BEGIN Remove spam referals
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_REFERER} ^.*(ranksonic\.|semalt\.|kambasoft\.|buttons-for-website\.|buttons-for-your-website\.com|4webmasters\.org|social-buttons\.com|best-seo-offer\.com|best-seo-solution\.com).*$ [NC]
RewriteRule ^(.*)$ - [F]
</ifModule>
# END Remove spam referals

# BEGIN Content-type MIME-disalow-mime manipulation
<IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"
</IfModule>
# END Content-type MIME-disalow-mime manipulation

# BEGIN P3P Policy
<IfModule mod_headers.c>
Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
</IfModule>
# END P3P Policy

# BEGIN Prevent clickjacking attempts
<IfModule mod_headers.c>
#Header always append X-Frame-Options SAMEORIGIN # Enable this, if server dosen't send this by default.
</IfModule>
# END Prevent clickjacking attempts

# BEGIN turn off Server Signatures
<IfModule mod_headers.c>
ServerSignature Off
</IfModule>
# END turn off Server Signatures

# BEGIN Refer policy
<IfModule mod_headers.c>
Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>
# END Refer policy

# BEGIN CSP
<IfModule mod_headers.c>
# Header set Content-Security-Policy "default-src 'self';" #Needs to be tailored to your specific needs.
</IfModule>
# END CSP

# BEGIN Feature/permissions policy
<IfModule mod_headers.c>
Header set Permissions-Policy "microphone=(), camera=(), geolocation=()"
</IfModule>
# END Feature/permissions policy

# BEGIN Set 404 to WP404
ErrorDocument 404 /index.php?error=404
# END Set 404 to WP404

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress

### marker BROWSER CACHE start ###
<IfModule mod_expires.c>
ExpiresActive 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 ###

0 comments on commit 7b7e5d7

Please sign in to comment.