.htaccess Scripts?

Want to chit chat about anything, do it here ... posting here won't increase your post count (or shouldn't!). Please do not post any "phpBB" specific topics here unless they do not fit into the category above. Do not post bug reports, feature or support requests!
Forum rules
Please do not post any "phpBB" specific topics here unless they do not fit into the category above.

Do not post bug reports, feature or support requests! No really... Do not post bug reports, feature or support requests! Doing so will make Bertie a very sad bear indeed. :(
Post Reply
User avatar
upsTex
Registered User
Posts: 95
Joined: Thu Apr 22, 2004 11:58 pm
Location: The Netherlands

.htaccess Scripts?

Post by upsTex »

Hi everyone,

I was wondering if anyone had any links or knows of any resources where
I can read up on how to use .htaccess scripts, because I've seen some more
complicated ones that do really cool and powerful stuff, but I can't seem to
find where to read about it.

Thanks for any help in advance!! :D
- upsTex
uranusalien
Registered User
Posts: 32
Joined: Mon Oct 27, 2003 4:48 pm
Contact:

Re: .htaccess Scripts?

Post by uranusalien »

.htaccess scripts are essentially like the httpd.conf Apache Config file, but some functions are disabled in them for security purposes.

For example, to prevent directory listings in a directory,

Code: Select all

Options -Indexes
To prevent specific files from being accessed...

Code: Select all

<Files "password.php">
Order allow,deny
Deny from all
</Files>
...or use wildcards:

Code: Select all

<Files "*.abc">
Order allow,deny
Deny from all
For more information, see the Apache documentation :)
User avatar
upsTex
Registered User
Posts: 95
Joined: Thu Apr 22, 2004 11:58 pm
Location: The Netherlands

Re: .htaccess Scripts?

Post by upsTex »

Thanks! But I'm talking about the more complicated ones, the ones that,
for example, would provide protection against hotlinking, such as this one:

Code: Select all

RewriteCond %{HTTP_REFERER} !^$ 
RewriteCond %{HTTP_REFERER} !^http://mysite.com.*$ [NC] 
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com.*$ [NC] 
RewriteCond %{HTTP_REFERER} !^http://mysite.com:80.*$ [NC] 
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://216.222.134.77.*$ [NC] 
RewriteCond %{HTTP_REFERER} !^http://216.222.134.77:80.*$ [NC] 
RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.mysite.com/no_hotlinking.php
" target="_blank

Does anyone know where to read up on this kind of .htaccess scripting?
- upsTex
Not Radio
Registered User
Posts: 159
Joined: Mon Oct 27, 2003 12:07 am
Contact:

Re: .htaccess Scripts?

Post by Not Radio »

See the docs for mod_rewrite.
User avatar
upsTex
Registered User
Posts: 95
Joined: Thu Apr 22, 2004 11:58 pm
Location: The Netherlands

Re: .htaccess Scripts?

Post by upsTex »

Thanks for the tip! :D
- upsTex
Post Reply