Support forums : The Future

avoid css @import?

The future of this project but not in a "I want a pony" sort of way. This is all about everything meta about Quam Plures. The general direction, the support tools, stuff like that.

Moderator: Dracones

Re: avoid css @import?

Postby EdB » Sat Apr 21, 2012 12:39 pm

The part of my .htaccess file that was useful for pagespeed is this bit:
Code: Select all
# improve pagespeed score / visitor experience
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A600
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/html A60
</IfModule>

Unfortunately I now have to do a lot of CTRL+F5 to see changes.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: avoid css @import?

Postby leeturner » Sat Apr 21, 2012 12:57 pm

That looks cool. I added similar:

Code: Select all
# Setting the Expires date to enable browser caching
ExpiresActive On
ExpiresDefault A0

# 1 YEAR - doesn't change often
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
</FilesMatch>

# 1 WEEK - possible to be changed, unlikely
<FilesMatch "\.(jpg|jpeg|png|gif|swf|txt|xml|js|css)$">
ExpiresDefault A604800
</FilesMatch>


I should have added the <IfModule mod_expires.c> bit though.

I also added compression:

Code: Select all
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript


Shall I branch and add this to the default sample.htaccess ?

Cheers
L
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: avoid css @import?

Postby EdB » Sat Apr 21, 2012 2:38 pm

compression is the one I kept saying "oh fuck this" which is what I say when I have no idea what they're talking about :)

Yeah for sure, do up a branch for an improved sample.htaccess file. Also, do you know why we have 2 of them? I think we have one in a folder somewhere for some reason. Having one per folder is valid, I just don't know why we have a second. If we don't need it let's toss it. One thing we need to make sure of is that we check the "if exists" type of conditions instead of assuming it'll work. Not sure how often that applies because I tinker in .htaccess VERY slowly and carefully. I search out a bunch of examples and combine what I learn into something I hope won't screw things up :)

ALSO just for grins here is my entire .htaccess file. Most of it is from the sample, some bits are what I do, and the last bit prevents hot-linking images. Anyway we might want to add in the "env=bad_bot" rejection routine, and we might want to add in the "env=spam_bot" bit. The trouble there is the user can't undo our decision easily.

Oh and the "wankers" bit is really cool, but it might be killing some antispam stuff. Specifically, when antispam offers to cast a wider net by checking .domain.com/foo/ if the first check is for .domain.com/foo/bar/ - which only happens when someone starts from the "ban" symbol. Anyway that bit is questionable as well.
Code: Select all
RewriteEngine on
# set the default file if no specific file requested
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>

# turn register globals off (for security)
<IfModule mod_php4.c>
php_flag register_globals off
</IfModule>

# improve pagespeed score / visitor experience
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A600
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/html A60
</IfModule>

# block ?disp=wankers
RewriteCond %{QUERY_STRING} disp=http [NC]
RewriteRule .* - [F]

<Files 403.shtml>
order allow,deny
allow from all
</Files>

SetEnvIfNoCase User-Agent "^aipbot" bad_bot
SetEnvIfNoCase User-Agent "^Alligator" bad_bot
SetEnvIfNoCase User-Agent "^ASPseek" bad_bot
SetEnvIfNoCase User-Agent "^autoemailspider" bad_bot
SetEnvIfNoCase User-Agent "^BDFetch" bad_bot
SetEnvIfNoCase User-Agent "^bew" bad_bot
SetEnvIfNoCase User-Agent "^cfetch" bad_bot
SetEnvIfNoCase User-Agent "^CherryPicker" bad_bot
SetEnvIfNoCase User-Agent "^Crescent" bad_bot
SetEnvIfNoCase User-Agent "^DA" bad_bot
SetEnvIfNoCase User-Agent "^Deweb" bad_bot
SetEnvIfNoCase User-Agent "^DigExt" bad_bot
SetEnvIfNoCase User-Agent "^DigOut4U" bad_bot
SetEnvIfNoCase User-Agent "^DISCoFinder" bad_bot
SetEnvIfNoCase User-Agent "^DotBot" bad_bot
SetEnvIfNoCase User-Agent "^Download\ Demon" bad_bot
SetEnvIfNoCase User-Agent "^Download\ Express" bad_bot
SetEnvIfNoCase User-Agent "^Download\ Wonder" bad_bot
SetEnvIfNoCase User-Agent "^DSurf" bad_bot
SetEnvIfNoCase User-Agent "^DreamPassport" bad_bot
SetEnvIfNoCase User-Agent "^DnloadMage" bad_bot
SetEnvIfNoCase User-Agent "^DTS Agent" bad_bot
SetEnvIfNoCase User-Agent "^eCatch" bad_bot
SetEnvIfNoCase User-Agent "^EBrowse" bad_bot
SetEnvIfNoCase User-Agent "^e-collector" bad_bot
SetEnvIfNoCase User-Agent "^EirGrabber" bad_bot
SetEnvIfNoCase User-Agent "^EmailCollector" bad_bot
SetEnvIfNoCase User-Agent "^EmailSiphon" bad_bot
SetEnvIfNoCase User-Agent "^EmailWolf" bad_bot
SetEnvIfNoCase User-Agent "^ESurf" bad_bot
SetEnvIfNoCase User-Agent "^Extractor" bad_bot
SetEnvIfNoCase User-Agent "^ExtractorPro" bad_bot
SetEnvIfNoCase User-Agent "^FAST-WebCrawler" bad_bot
SetEnvIfNoCase User-Agent "^Fetcher" bad_bot
SetEnvIfNoCase User-Agent "^FEZhead" bad_bot
SetEnvIfNoCase User-Agent "^FileHound" bad_bot
SetEnvIfNoCase User-Agent "^FileHeap" bad_bot
SetEnvIfNoCase User-Agent "^Franklin Locator" bad_bot
SetEnvIfNoCase User-Agent "^FreshDownload" bad_bot
SetEnvIfNoCase User-Agent "^FSurf" bad_bot
SetEnvIfNoCase User-Agent "^Gamespy_Arcade" bad_bot
SetEnvIfNoCase User-Agent "^Gaisbot" bad_bot
SetEnvIfNoCase User-Agent "^GetWebPage" bad_bot
SetEnvIfNoCase User-Agent "^Getleft" bad_bot
SetEnvIfNoCase User-Agent "^GetURL" bad_bot
SetEnvIfNoCase User-Agent "^GetBot" bad_bot
SetEnvIfNoCase User-Agent "^GetRight" bad_bot
SetEnvIfNoCase User-Agent "^Go!Zilla" bad_bot
SetEnvIfNoCase User-Agent "^Go-Ahead-Got-It" bad_bot
SetEnvIfNoCase User-Agent "^HLoader" bad_bot
SetEnvIfNoCase User-Agent "^HTTrack" bad_bot
SetEnvIfNoCase User-Agent "^IBM_Planetwide" bad_bot
SetEnvIfNoCase User-Agent "^iGetter" bad_bot
SetEnvIfNoCase User-Agent "^Industry\ Program" bad_bot
SetEnvIfNoCase User-Agent "^Indy\ Library" bad_bot
SetEnvIfNoCase User-Agent "^InstallShield\ DigitalWizard" bad_bot
SetEnvIfNoCase User-Agent "^IUPUI Research Bot" bad_bot
SetEnvIfNoCase User-Agent "^JoBo" bad_bot
SetEnvIfNoCase User-Agent "^JOC Web Spider" bad_bot
SetEnvIfNoCase User-Agent "^KWebGet" bad_bot
SetEnvIfNoCase User-Agent "^Kapere" bad_bot
SetEnvIfNoCase User-Agent "^Kyluka\ krawl" bad_bot
SetEnvIfNoCase User-Agent "^Larbin" bad_bot
SetEnvIfNoCase User-Agent "^LeechGet" bad_bot
SetEnvIfNoCase User-Agent "^LightningDownload" bad_bot
SetEnvIfNoCase User-Agent "^LinkWalker" bad_bot
SetEnvIfNoCase User-Agent "^LWP" bad_bot
SetEnvIfNoCase User-Agent "^Mac Finder" bad_bot
SetEnvIfNoCase User-Agent "^Mail\ Sweeper" bad_bot
SetEnvIfNoCase User-Agent "^Mass\ Downloader" bad_bot
SetEnvIfNoCase User-Agent "^MCspider" bad_bot
SetEnvIfNoCase User-Agent "^MetaProducts\ Download\ Express" bad_bot
SetEnvIfNoCase User-Agent "^Microsoft\ URL Control" bad_bot
SetEnvIfNoCase User-Agent "^Mirror" bad_bot
SetEnvIfNoCase User-Agent "^Missauga\ Locate" bad_bot
SetEnvIfNoCase User-Agent "^Missauga\ Locator" bad_bot
SetEnvIfNoCase User-Agent "^Missouri\ College Browse" bad_bot
SetEnvIfNoCase User-Agent "^Mister\ PiX" bad_bot
SetEnvIfNoCase User-Agent "^MJ12bot" bad_bot
SetEnvIfNoCase User-Agent "^Monster" bad_bot
SetEnvIfNoCase User-Agent "^MovableType" bad_bot
SetEnvIfNoCase User-Agent "^Mozi!" bad_bot
SetEnvIfNoCase User-Agent "^Mozilla/3.0 (compatible)" bad_bot
SetEnvIfNoCase User-Agent "^MSIE_6.0" bad_bot
SetEnvIfNoCase User-Agent "^MyGetRight" bad_bot
SetEnvIfNoCase User-Agent "^NetCarta" bad_bot
SetEnvIfNoCase User-Agent "^NetAnts" bad_bot
SetEnvIfNoCase User-Agent "^NEWT ActiveX" bad_bot
SetEnvIfNoCase User-Agent "^NICErsPRO" bad_bot
SetEnvIfNoCase User-Agent "^Nitro\ Downloader" bad_bot
SetEnvIfNoCase User-Agent "^Nutch" bad_bot
SetEnvIfNoCase User-Agent "^Ocelli" bad_bot
SetEnvIfNoCase User-Agent "^Offline\ Explorer" bad_bot
SetEnvIfNoCase User-Agent "^OpaL" bad_bot
SetEnvIfNoCase User-Agent "^PackRat" bad_bot
SetEnvIfNoCase User-Agent "^PageDown" bad_bot
SetEnvIfNoCase User-Agent "^PagmIEDownload" bad_bot
SetEnvIfNoCase User-Agent "^pavuk" bad_bot
SetEnvIfNoCase User-Agent "^Program\ Shareware" bad_bot
SetEnvIfNoCase User-Agent "^Progressive\ Download" bad_bot
SetEnvIfNoCase User-Agent "^Purebot" bad_bot
SetEnvIfNoCase User-Agent "^PushSite" bad_bot
SetEnvIfNoCase User-Agent "^PuxaRapido" bad_bot
SetEnvIfNoCase User-Agent "^Python-urllib" bad_bot
SetEnvIfNoCase User-Agent "^RealDownload" bad_bot
SetEnvIfNoCase User-Agent "^RepoMonkey\ Bait" bad_bot
SetEnvIfNoCase User-Agent "^Rsync" bad_bot
SetEnvIfNoCase User-Agent "^Shai" bad_bot
SetEnvIfNoCase User-Agent "^sitecheck" bad_bot
SetEnvIfNoCase User-Agent "^SiteMapper" bad_bot
SetEnvIfNoCase User-Agent "^SiteSnagger" bad_bot
SetEnvIfNoCase User-Agent "^SmartDownload" bad_bot
SetEnvIfNoCase User-Agent "^sohu\ agent" bad_bot
SetEnvIfNoCase User-Agent "^Sosospider" bad_bot
SetEnvIfNoCase User-Agent "^SpeedDownload" bad_bot
SetEnvIfNoCase User-Agent "^Spegla" bad_bot
SetEnvIfNoCase User-Agent "^SpiderBot" bad_bot
SetEnvIfNoCase User-Agent "^Spinn3r" bad_bot
SetEnvIfNoCase User-Agent "^SQ\ Webscanner" bad_bot
SetEnvIfNoCase User-Agent "^Stamina" bad_bot
SetEnvIfNoCase User-Agent "^Star\ Downloader" bad_bot
SetEnvIfNoCase User-Agent "^SuperBot" bad_bot
SetEnvIfNoCase User-Agent "^tarspider" bad_bot
SetEnvIfNoCase User-Agent "^Teleport" bad_bot
SetEnvIfNoCase User-Agent "^Templeton" bad_bot
SetEnvIfNoCase User-Agent "^Titan" bad_bot
SetEnvIfNoCase User-Agent "^Turing\ Machine" bad_bot
SetEnvIfNoCase User-Agent "^TurnitinBot" bad_bot
SetEnvIfNoCase User-Agent "^UdmSearch" bad_bot
SetEnvIfNoCase User-Agent "^URLGetFile" bad_bot
SetEnvIfNoCase User-Agent "^UtilMind" bad_bot
SetEnvIfNoCase User-Agent "^voyager" bad_bot
SetEnvIfNoCase User-Agent "^Web2Map" bad_bot
SetEnvIfNoCase User-Agent "^WebAuto" bad_bot
SetEnvIfNoCase User-Agent "^WebCapture" bad_bot
SetEnvIfNoCase User-Agent "^webcollage" bad_bot
SetEnvIfNoCase User-Agent "^WebCopier" bad_bot
SetEnvIfNoCase User-Agent "^WebCopy" bad_bot
SetEnvIfNoCase User-Agent "^Web\ Downloader" bad_bot
SetEnvIfNoCase User-Agent "^Webdupe" bad_bot
SetEnvIfNoCase User-Agent "^WebFetch" bad_bot
SetEnvIfNoCase User-Agent "^webfetcher" bad_bot
SetEnvIfNoCase User-Agent "^WebFountain" bad_bot
SetEnvIfNoCase User-Agent "^WebHook" bad_bot
SetEnvIfNoCase User-Agent "^Web\ Image" bad_bot
SetEnvIfNoCase User-Agent "^WebMiner" bad_bot
SetEnvIfNoCase User-Agent "^WebMirror" bad_bot
SetEnvIfNoCase User-Agent "^WebReaper" bad_bot
SetEnvIfNoCase User-Agent "^WebSauger" bad_bot
SetEnvIfNoCase User-Agent "^Webster" bad_bot
SetEnvIfNoCase User-Agent "^WebStripper" bad_bot
SetEnvIfNoCase User-Agent "^Web\ Sucker" bad_bot
SetEnvIfNoCase User-Agent "^webvac" bad_bot
SetEnvIfNoCase User-Agent "^webwalk" bad_bot
SetEnvIfNoCase User-Agent "^WebWhacker" bad_bot
SetEnvIfNoCase User-Agent "^Website\ eXtractor" bad_bot
SetEnvIfNoCase User-Agent "^WebZIP" bad_bot
SetEnvIfNoCase User-Agent "^Wells\ Search" bad_bot
SetEnvIfNoCase User-Agent "^WEP\ Search" bad_bot
SetEnvIfNoCase User-Agent "^Wget" bad_bot
SetEnvIfNoCase User-Agent "^Wildsoft\ Surfer" bad_bot
SetEnvIfNoCase User-Agent "^WUMPUS" bad_bot
SetEnvIfNoCase User-Agent "^WWWOFFLE" bad_bot
SetEnvIfNoCase User-Agent "^w3mir" bad_bot
SetEnvIfNoCase User-Agent "^Xaldon\ WebSpider" bad_bot
SetEnvIfNoCase User-Agent "^XGET" bad_bot
SetEnvIfNoCase User-Agent "^xirq" bad_bot
SetEnvIfNoCase User-Agent "^YandexBot" bad_bot
SetEnvIfNoCase User-Agent "^Yanga\ WorldSearch\ Bot" bad_bot
SetEnvIfNoCase User-Agent "^ZBot" bad_bot
SetEnvIfNoCase User-Agent "^Zeus" bad_bot
<Limit GET POST>
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</Limit>

SetEnvIfNoCase Referer ".*(more-poker).*" spam_bot
SetEnvIfNoCase Referer ".*(ooo-casino|hotelgaydays).*" spam_bot
SetEnvIfNoCase Referer ".*(sexdragsandrocknroll).*" spam_bot
SetEnvIfNoCase Referer ".*(ambien|-anal|anal-|betting).*" spam_bot
SetEnvIfNoCase Referer ".*(casino|-cialis|cialis-|credit-).*" spam_bot
SetEnvIfNoCase Referer ".*(-deal|-drugs|deal-|drugs-).*" spam_bot
SetEnvIfNoCase Referer ".*(finance|fioricet|forex).*" spam_bot
SetEnvIfNoCase Referer ".*(gambling).*" spam_bot
SetEnvIfNoCase Referer ".*(hardcore|hold-em|holdem|hoodia|-hotel|hotel-).*" spam_bot
SetEnvIfNoCase Referer ".*(insurance|jintropin|lenarcic).*" spam_bot
SetEnvIfNoCase Referer ".*(levitra|-loan|loan-).*" spam_bot
SetEnvIfNoCase Referer ".*(mature|meridia|mortgage).*" spam_bot
SetEnvIfNoCase Referer ".*(pharmacy|phentermine|pills-|-pills|poker-|-poker).*" spam_bot
SetEnvIfNoCase Referer ".*(shemale|tramadol).*" spam_bot
SetEnvIfNoCase Referer ".*(volny|viagra|xanax).*" spam_bot

<Limit GET POST>
Order Allow,Deny
Allow from all
Deny from env=spam_bot
</Limit>

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://1912webworks.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://1912webworks.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.1912webworks.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.1912webworks.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

FINALLY I've always wanted to add a default-off checkbox to the installer that builds a real .htaccess from sample and the $app_baseurl (or whatever we call that part now).
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Previous

Return to The Future

Who is online

Users browsing this forum: No registered users and 1 guest

cron