Jump to content

Editing the original PW .htaccess file best practice?


a-ok
 Share

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...