a-ok Posted March 12, 2020 Share Posted March 12, 2020 I want to add disabling of hot-linking for webfonts to the .htaccess file but I kinda don't want to 'mess' with the one that comes with PW. What would you suggest? Does anyone else do specific .htaccess additions without adjusting the original PW version? Or am I just being silly? RewriteEngine On # RewriteCond %{HTTP_REFERER} !^http(.?)://(.+\.)?yourdomain\.com/ [NC] # RewriteRule .*\.(woff|ttf|eot|svg|php)$ - [F] AddType application/vnd.ms-fontobject .eot AddType application/x-font-woff .woff AddType font/ttf .ttf AddType image/svg+xml .svg AddType text/css .css <FilesMatch "\.(woff|ttf|svg|eot|css)$"> <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" </IfModule> </FilesMatch> Link to comment Share on other sites More sharing options...
dragan Posted March 12, 2020 Share Posted March 12, 2020 Well, as long as it works, it works. Of course, you should always keep a backup in case you break something. The only stuff I usually add is blocking bad bots and some performance tweaks (compression, cache rules). Link to comment Share on other sites More sharing options...
a-ok Posted March 12, 2020 Author Share Posted March 12, 2020 19 minutes ago, dragan said: Well, as long as it works, it works. Of course, you should always keep a backup in case you break something. The only stuff I usually add is blocking bad bots and some performance tweaks (compression, cache rules)./ Would you just add at the bottom, or create a new section '5B' or something so it keeps everything tidy or avoid this so you know what is yours/PWs standard? Link to comment Share on other sites More sharing options...
dragan Posted March 12, 2020 Share Posted March 12, 2020 I always keep separate blocks at the bottom. In any case, I add lots of comments, so I know what each block is supposed to do, if I have to touch it years later ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now