I installed the wp super cache plugin for wordpress on the server and it works fine. But I can not figure out why my .htaccess rules do not work for the homepage.
I make rewrite of the requests for the subdomain www to a folder with a installation of wordpress, www / .htaccess:
# www (blog)
RewriteCond %{HTTP_HOST}% ^www\.domain\. [NC]
RewriteCond %{REQUEST_URI} !^/wp_inspiracoes/
RewriteCond %{REQUEST_URI} !^/index\.php/
RewriteCond %{REQUEST_URI} !^/css/
RewriteCond %{REQUEST_URI} !^/js/
RewriteCond %{REQUEST_URI} !^/fonts/
RewriteCond %{REQUEST_URI} !^/img/
RewriteRule ^(.*) /wp_inspiracoes/$1 [L]
# Rewrite all other URLs to index.php/URL (in house app)
RewriteRule .* index.php/$0 [PT]
And in the www / wp_inspiracoes / .htaccess:
RewriteBase /
#full page cache
RewriteCond %{DOCUMENT_ROOT}/wp_inspiracoes/wp-content/cache/supercache/%{SERVER_NAME}/$1index-https.html -f
RewriteRule ^(.*) "/wp_inspiracoes/wp-content/cache/supercache/%{SERVER_NAME}/$1index-https.html" [L]
# BEGIN WordPress
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
These rules work for accesses such as www.domain.com/algum-post/ and www.domain.com/outro-post/ and rewrite the static local files generated by the wp super cache plugin:
.../wp-content/cache/supercache/www.domain.com/index-https.html
.../wp-content/cache/supercache/www.domain.com/algum-post/index-https.html
.../wp-content/cache/supercache/www.domain.com/outro-post/index-https.html
But they do NOT work for access on www.domain.com (homepage), which should do rewrite to ... / supercache / www.domain.com / index-https.html
So I tried some specific rules for homepage in www / wp_inspiracoes / .htaccess (before the general cache rules did not work):
# homepage rules
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{DOCUMENT_ROOT}/wp_inspiracoes/wp-content/cache/supercache/%{SERVER_NAME}/index-https.html -f
RewriteRule ^(.*) "/wp_inspiracoes/wp-content/cache/supercache/%{SERVER_NAME}/index-https.html" [L]
# full page cache here
I tried several rules for home but they also did not work:
# homepage rules
RewriteCond %{DOCUMENT_ROOT}/wp_inspiracoes/wp-content/cache/supercache/%{SERVER_NAME}/index-https.html -f
RewriteRule ^$ "/wp_inspiracoes/wp-content/cache/supercache/%{SERVER_NAME}/index-https.html" [L]
# full page cache here
Even those rules in www / .htaccess (before the rules that rewrite from www to folder wp_inspirations) also did not work
> RewriteCond %{HTTP_HOST}% ^www\.domain\. [NC]
> RewriteCond %{REQUEST_URI} ^/$
> RewriteCond %{DOCUMENT_ROOT}/wp_inspiracoes/wp-content/cache/supercache/%{SERVER_NAME}/index-https.html
> -f
> RewriteRule ^(.*) "/wp_inspiracoes/wp-content/cache/supercache/%{SERVER_NAME}/index-https.html"
> [L]
>
> # www to /wp_inspiracoes rules here
If someone can please help me with these rules, to work for both homepage (/) and pros posts (/ some-post) Duvida_sobre_htacces_SO_en.txtOpen Viewing Duvida_sobre_htacces_SO_en.txt.