pavement

.htaccess

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(minor updates)
m (Reverted edits by DavidYoung (talk) to last revision by 200.38.30.168)
 
Line 38: Line 38:
  
 
[[Category:Important Config Files]]
 
[[Category:Important Config Files]]
 
== World Book Night: Millions of Free Books Donated ==
 
 
A young woman is jumping up and down in front of the New York Public Library wearing a sandwich sign that says, "Hate Reading? Talk To Me!" Shes waving around several copies of "The Glass Castle" by Jeannette Walls, eager to get them off her hands.Men and women in suits breeze by, but some passersby are curious about the spectacle. If you were roaming the streets of New York City or London last night you may have encountered a similar scene: Zealous readers handing out award-winning novels by the boxful.
 
 
[[http://goodvillenews.com/World-Book-Night-Millions-of-Free-Books-Donated-J7S8iH.html World Book Night: Millions of Free Books Donated]]
 
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 
 
== 7 Choices You Always Have (that you dont always give yourself) ==
 
 
I believe the choice to be excellent begins with aligning your thoughts and words with the intention to require more from yourself. ~ Oprah WinfreyMaking choices is probably the most stressful thing that we do as humans. Or perhaps more accurately, the stressful thing we do is to choose avoidance when we dont like what choices were facing. This is what creates the stress.
 
 
[[http://goodvillenews.com/7-Choices-You-Always-Have-that-you-dont-always-give-yourself-RRF.html 7 Choices You Always Have (that you dont always give yourself)]]
 
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 
 
== 5 Principles for Inner Transformation at Work ==
 
 
People go to work to sustain themselves and produce value in the world. Yet work environments can also be stressful, filled with challenging responsibilities and personalities, and feel misaligned with our most deeply cherished values. Instead of sustaining us, the workplace can sometimes feel simply draining, and at worst, unwholesome for both ourselves and the world.
 
 
[[http://goodvillenews.com/5-Principles-for-Inner-Transformation-at-Work-TTklKV.html 5 Principles for Inner Transformation at Work]]
 
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 
 
== A Savior At the Grocery Store ==
 
 
Numbly, I left my husband, Marty, at the hospital where I had been visiting two of my children and headed for the grocery store. Since it was eleven p.m., I drove to the only store I knew was open twenty-four hours a day. I turned my car motor off and rested my head against the seat.
 
 
[[http://goodvillenews.com/A-Savior-At-the-Grocery-Store-XTmcwi.html A Savior At the Grocery Store]]
 
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 
 
== Little Things You Can Do to Make the World a Lot Nicer ==
 
 
A few years ago, Debbie Tenzer was feeling overwhelmed by all the crises in the news. But rather than give in to despair, she thought, Maybe I cant solve our big problems, but I know I can do something.
 
 
[[http://goodvillenews.com/Little-Things-You-Can-Do-to-Make-the-World-a-Lot-Nicer-PxxL5F.html Little Things You Can Do to Make the World a Lot Nicer]]
 
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 

Latest revision as of 17:30, 25 August 2012

You can place a .htaccess file in a directory serviced by apache to override server default behaviors without needing to alter httpd.conf or even to restart Apache - assuming, of course, that the directory in question has been allowed override privileges for the things you want to do!

For example, assuming mod_rewrite is installed and available in Apache, you can do the following in the .htaccess file in the root of a site to redirect an insecure http request to the same site via secure https:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Or if you want to block off a pesky spammer-ridden IP block from posting things to a blog or wiki, while still allowing people on that block to READ the blog or wiki or what have you:

AuthName "Anti-Spam Protection"
AuthType Basic
<Limit PUT POST>
order allow,deny
allow from all

# CHINANET telcom - 2006-03-02
deny from 212.0.0.0/8
deny from 216.0.0.0/8
deny from 218.0.0.0/8
deny from 221.0.0.0/8
deny from 61.144.0.0/14
</Limit>

Note that comments - prefaced by # signs - ARE allowed in .htaccess files. Use this to your advantage!

What if you want to require a password for a certain directory?

# require a username and password to get into this lightly secured area
AuthType Basic
# note: it's safest to keep the password file OUTSIDE the webroot!
AuthUserFile ../.htpasswd
AuthName "JRS Systems Personnel Only"
require valid-user
satisfy any

Of course, this requires you to actually have a .htpasswd file in the appropriate location - you can use the htpasswd utility to create one for you.

Personal tools