Problems with optimizing website
-
Hello guys! I want to optimize my website for faster loading and less CPU cycles of my host.
I started with the “.htaccess” file and “cloudflare”, but I encounter problems with both.
1. ‘.htaccess’ error when attempting to activate all redirects to be to “https://www.” from my cPanel “redirects” part:
The system failed to add the redirect because of the following errors:Error:
Apache detected an error in the Rewrite config.
httpd: Syntax error on line 50 of /home/Domain/public_html/.htaccess.pY4l8ozyHLHkPSkYnE3IJWJU7nxg5Jne: </Directory> without matching <Directory> section
Please try again.
.htaccess file:
Header set Cache-Control "max-age=2628000, public"
<IfModule mod_alias.c>## EXPIRES CACHING ##
<IfModule mod_expires.c>
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 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"
</IfModule>
## EXPIRES CACHING ### BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
AddHandler application/x-httpd-php56 .php .php5 .php4 .php32. Cloudflare error: “error too many redirects” -> solution activate only “https” redirects” (not found in the cPanel “cloudflare” section, I only have the “activate” button).
Can anyone please tell me if they are ok:
- The topic ‘Problems with optimizing website’ is closed to new replies.