Page specific .htaccess file in RapidWeaver 8

I have a guy who is doing some editing on my website.

We found in RapidWeaver 8 how you can create and edit the file in Publishing > Edit .htaccess File.

However, if I understand correctly, he also wants to do a page-specific .htaccess file.

Is this possible? If so, what do we need to do?

You can do a page specific .htaccess through RW8, only the master one. He would have to add specific .htaccess files in each folder on the server.

1 Like

As @NeilUK said not with RapidWeaver alone. Any plain text editor will work for creating an .htaccess file. It must be plain text and called .htaccess with the dot.
Once created you will need an ftp client such as transmit(paid) or FileZilla (free) to place the file on the server.

2 Likes

I have an update. He says:

“We added a code in the main .htaccess file to remove the errors in gtmatrix.com and it worked for the home page. For the inner page the same errors are showing and I added the same .htaccess file in the folder and tested that page. But the errors are still there. It seem adding the .htaccess file didn’t work there.”

What code did he add? What are the errors?

He says these are the errors:

Enable gzip compression
Leverage browser caching

And this is the code:

mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* ExpiresActive On ExpiresDefault "access plus 1 seconds" # Images ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/webp "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 month" ExpiresByType image/x-icon "access plus 1 month" ExpiresByType image/x-ico "access plus 1 month" ExpiresByType text/x-javascript "access 1 month" ExpiresByType text/css "access plus 1 month" ExpiresByType application/x-font-woff "access plus 1 year"

Oh boy, let me guess… an SEO “expert”?

With most hosts you can turn this on yourself right in Cpanel and choose which file types to compress.

What are you actually trying to accomplish?

1 Like

What Scott(@swilliam) said.

What are you attempting to do?

Do you have a URL?

This is the URL: About Jaacob Bowden & His History

He’s inputted the URL in to gtmetrix.com and got the following performance:

Using the code I had pasted above, he says he was able to resolve the “Enable gzip compression” and “Leverage browser caching” errors on the home page…but it didn’t work on the About Jaacob Bowden & His History page.

These are the drop-down details of the “Enable gzip compression”:

These are the details from the “Leverage browser caching”:

OK,
Never heard of that test tool, but I just checked:

And it is showing compression (gzip) is on.

Also, rain a speed test and it shows it turned on as well, not to mention the pages are quite light in wieght.

I don’t think I would have turned gzip on that way unless that was the only way. As Scott pointed out there is usually an easier way in the cPanel, normally under something like Website Optimization icon on cPanel.

There’s also usually some sort of “Cache Manager” option to setup cache expiry info.

You didn’t say who your hosting company is, so I don’t know what options you might have.

And of course, you could set up a CloudFlare account and that would take care of both those issues and more.

2 Likes

Thank you. I will pass the word on to him.

The hosting company is InMotion Hosting:

https://www.inmotionhosting.com/

Just looked at their(in motion) support area:

gzip:
https://www.inmotionhosting.com/support/website/what-is/how-to-enable-gzip-moddeflate

look for the part headlined:

Enabling mod_deflate (gzip compression) in cPanel

I didn’t look up cache management, but they have a serach in that support area.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.