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!!
.htaccess Scripts?
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. :(
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. :(
.htaccess Scripts?
- upsTex
-
- Registered User
- Posts: 32
- Joined: Mon Oct 27, 2003 4:48 pm
Re: .htaccess Scripts?
.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,
To prevent specific files from being accessed......or use wildcards:
For more information, see the Apache documentation
For example, to prevent directory listings in a directory,
Code: Select all
Options -Indexes
Code: Select all
<Files "password.php">
Order allow,deny
Deny from all
</Files>
Code: Select all
<Files "*.abc">
Order allow,deny
Deny from all
Re: .htaccess Scripts?
Thanks! But I'm talking about the more complicated ones, the ones that,
for example, would provide protection against hotlinking, such as this one:
" target="_blank
Does anyone know where to read up on this kind of .htaccess scripting?
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
Does anyone know where to read up on this kind of .htaccess scripting?
- upsTex
Re: .htaccess Scripts?
See the docs for mod_rewrite.