apparition.Designs | version 2 | anything you can imagine is real

.Welcome to apparition.Designs [apparitiondesigns.com]

Hello, we are currently under development and are trying to get all our content up as soon as possible. We hope to get the site up, tweaked, and bug-free A.S.A.P. If you have any questions or comments on what you have (or havent) seen so far, feel free to email me at StratzSfear@apparitionDesigns.com

 
 

.other ways of using .htaccess...

.Ban User by IP

If you have a troublesome user and you know his/her IP address you can completly ban them from accessing your site.

order allow,deny
deny from 199.150.123.99
deny from 199.150.123
allow from all

Now to explain that code just a little bit better, the first "deny from" line would ban a single IP address. But it is possible the troublesome user does not have a static IP address. To deal with that, we ban all IPs from a certain block (199.150.123.1 199.150.123.2 ... etc). Unfortunatly this can possibly ban other users and it is not a suggested route to take.

.use annother page for your default page (instead of index.somthing)

Say you have a script, or have annother reason that the file you want to be loaded by default, you can do it by adding this to your .htaccess:

 DirectoryIndex filename.html index.cgi index.pl default.htm

Notice how you can have more than one file in there? Don't do this unless you actually need to, usually your host will have it set up well.

.redirect pages and DIRECTORIES!

Redirect /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html

or

Redirect /olddirectory/ http://yoursite.com/newdirectory

That seems pretty self explanatory doesn't it? You can use this if you notice a certain file or directory is still being used a lot even if you have moved it.. this way it keeps the 404 errors to a minimum!

.STOP HOT LINKING!

Yes.. we all know of it, and we all hate it... some body comes across an image on your site that they love, and what do they do? They post it on their own site, stealing credit AND bandwidth. This will help you deal with it! For this to work you need mod_rewrite to be allowed on your server. Ask your host if its on for your site.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?site.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://site.com/hl.jpg [R,L]

If you dont have mod_rewrite, you can still disable hot-linking... All that will be displayed is a broken image (red X) though.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?site.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]

Of course make sure that you rename site.com to your own site name and the image. Now I don't know if there is an easy work around for it, but you can use a free annonymizer like http://invis.free.anonymizer.com/ What you do is paste http://invis.free.anonymizer.com/ infront of your image url when you post it (like on a forum) so it ends up like http://invis.free.anonymizer.com/http://apparitiondesigns.com/art/vectorgirl_small.png So only do this if you dont plan on posting the images all over, yourself.

.Stop listing of empty directories...

If you have a lot of directories of images that you dont want to have browsed through, and you dont have time to put a blank index.html in all of the folders, then you can use one of the following.

Options Includes FollowSymLinks

The .htaccess file will have effect on all directories "below" the one it is in. So if you wanted only your directories in, for example, www/my_private_stuff/ to be protected you could place it in your www/my_private_stuff/ directory and it would only have effect on the files "below" www/my_private_stuff.

OR...

IndexIgnore *

or

IndexIgnore *.gif *.jpg

This uses * as a wild card and will not list any files in that directory. The other one just doesn't list gif or jpg files; you can continue the list to other files also.

Page 1, 2, 3, 4