User Tools

Site Tools


computing:selfhostedwp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:selfhostedwp [2026/04/12 15:49] oemb1905computing:selfhostedwp [2026/04/12 15:53] (current) oemb1905
Line 140: Line 140:
 After isntalling memcached and enabling those modules, navigate to your web root and adjust your .htaccess as follows: After isntalling memcached and enabling those modules, navigate to your web root and adjust your .htaccess as follows:
  
-  <IfModule mod_expires.c> +<code> 
-          ExpiresActive On +<IfModule mod_expires.c> 
-          ExpiresByType image/jpg "access 1 year" +    ExpiresActive On 
-          ExpiresByType image/jpeg "access 1 year" +    ExpiresByType image/jpg "access 1 year" 
-          ExpiresByType image/gif "access 1 year" +    ExpiresByType image/jpeg "access 1 year" 
-          ExpiresByType image/png "access 1 year" +    ExpiresByType image/gif "access 1 year" 
-          ExpiresByType text/css "access 1 week" +    ExpiresByType image/png "access 1 year" 
-          ExpiresByType text/html "access 1 month" +    ExpiresByType text/css "access 1 week" 
-          ExpiresByType text/x-javascript "access 1 week" +    ExpiresByType text/html "access 1 month" 
-          ExpiresDefault "access 1 month" +    ExpiresByType text/x-javascript "access 1 week" 
-  </IfModule>+    ExpiresDefault "access 1 month" 
 +</IfModule
 +</code>
  
-  <IfModule mod_rewrite.c> +<code> 
-          RewriteEngine On +<IfModule mod_rewrite.c> 
-          RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] +    RewriteEngine On 
-          RewriteBase / +    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 
-          RewriteRule ^index\.php$ - [L] +    RewriteBase / 
-          RewriteCond %{REQUEST_FILENAME} !-f +    RewriteRule ^index\.php$ - [L] 
-          RewriteCond %{REQUEST_FILENAME} !-d +    RewriteCond %{REQUEST_FILENAME} !-f 
-          RewriteRule . /index.php [L] +    RewriteCond %{REQUEST_FILENAME} !-d 
-          <FilesMatch "\.(js|css|jpe?g|png|gif|eot|otf|svg|ttf|woff2?)$"> +    RewriteRule . /index.php [L] 
-                  Header set Timing-Allow-Origin "*" +    <FilesMatch "\.(js|css|jpe?g|png|gif|eot|otf|svg|ttf|woff2?)$"> 
-          </FilesMatch> +        Header set Timing-Allow-Origin "*" 
-  </IfModule>+    </FilesMatch> 
 +</IfModule
 +</code>
  
-  <IfModule mod_headers.c>+<code> 
 +<IfModule mod_headers.c>
     # X-origin core security headers     # X-origin core security headers
     Header always set X-Content-Type-Options "nosniff"     Header always set X-Content-Type-Options "nosniff"
     Header always set X-Frame-Options "SAMEORIGIN"     Header always set X-Frame-Options "SAMEORIGIN"
     Header always set Referrer-Policy "strict-origin-when-cross-origin"     Header always set Referrer-Policy "strict-origin-when-cross-origin"
- 
     # HSTS     # HSTS
     Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" env=HTTPS     Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" env=HTTPS
- 
     # Feature Policy     # Feature Policy
     Header always set Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), fullscreen=*"     Header always set Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), fullscreen=*"
- 
     # Cross Origin Openerand Embedder policies permissive for Gutenberg/iframes     # Cross Origin Openerand Embedder policies permissive for Gutenberg/iframes
     Header always set Cross-Origin-Opener-Policy "same-origin-allow-popups"     Header always set Cross-Origin-Opener-Policy "same-origin-allow-popups"
     Header always set Cross-Origin-Embedder-Policy "unsafe-none"     Header always set Cross-Origin-Embedder-Policy "unsafe-none"
- 
     # Cache and download protections; limited to dynamic files     # Cache and download protections; limited to dynamic files
     <FilesMatch "\.(php|html)$">     <FilesMatch "\.(php|html)$">
Line 188: Line 189:
         Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"         Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
     </FilesMatch>     </FilesMatch>
- 
     # Safe CSP for WordPress + Gutenberg      # Safe CSP for WordPress + Gutenberg 
     <FilesMatch "\.(php|html)$">     <FilesMatch "\.(php|html)$">
Line 205: Line 205:
     </FilesMatch>     </FilesMatch>
 </IfModule> </IfModule>
 +</code>
  
 I was getting a stubborn TLS redirect error for images. To address this, I went into ''/wp-content/themes/mytheme/header.php'' and added: I was getting a stubborn TLS redirect error for images. To address this, I went into ''/wp-content/themes/mytheme/header.php'' and added:
computing/selfhostedwp.1776008969.txt.gz · Last modified: by oemb1905