Google
Free Ads
Ads United Kingdom
Ads Deutschland
Ads France
Ads Brasil
Ads India
Ads Mexico
Ads Argentina
Ads Österreich
Ads Belgique
Ads Chile
Ads Venezuela
Hauptmenü
HomeLexikonFreeadsNewsBranchenbuchDownloadsWeblinksForumTutorialsbamaGalerieNewsletterFAQHeadlinesPartnerseitenKontakt/Info
Information

Webmasters
Philippe 
frank 
ralph 

CMS - Content Management : .htaccess, Part 2 - .htaccess Commands

Weiterempfehlen

Neue Tutorials
 · Part 3 - Password Protect..
 · Part 1 - Introduction
 · Part 2 - .htaccess Comman..
 · test Article 4 this
 • Propaganda I


Dokumente
Part 2 - .htaccess Commands
geschrieben von: frank, am: 16.11.2006 
Stop A Directory Index From Being Shown

Sometimes, for one reason or another, you will have no index file in your directory. This will, of course, mean that if someone types the directory name into their browser, a full listing of all the files in that directory will be shown. This could be a security risk for your site.

To prevent against this (without creating lots of new 'index' files, you can enter a command into your .htaccess file to stop the directory list from being shown:

Options -Indexes

Deny/Allow Certian IP Addresses

In some situations, you may want to only allow people with specific IP addresses to access your site (for example, only allowing people using a particular ISP to get into a certian directory) or you may want to ban certian IP addresses (for example, keeping disruptive memembers out of your message boards). Of course, this will only work if you know the IP addresses you want to ban and, as most people on the internet now have a dynamic IP address, so this is not always the best way to limit usage.

You can block an IP address by using:

deny from 000.000.000.000

where 000.000.000.000 is the IP address. If you only specify 1 or 2 of the groups of numbers, you will block a whole range.

You can allow an IP address by using:

allow from 000.000.000.000

where 000.000.000.000 is the IP address. If you only specify 1 or 2 of the groups of numbers, you will allow a whole range.

If you want to deny everyone from accessing a directory, you can use:

deny from all

but this will still allow scripts to use the files in the directory.

Alternative Index Files

You may not always want to use index.htm or index.html as your index file for a directory, for example if you are using PHP files in your site, you may want index.php to be the index file for a directory. You are not limited to 'index' files though. Using .htaccess you can set foofoo.blah to be your index file if you want to!

Alternate index files are entered in a list. The server will work from left to right, checking to see if each file exists, if none of them exisit it will display a directory listing (unless, of course, you have turned this off).

DirectoryIndex index.php index.php3 messagebrd.pl index.html index.htm

Redirection

One of the most useful functions of the .htaccess file is to redirect requests to different files, either on the same server, or on a completely different web site. It can be extremely useful if you change the name of one of your files but allow users to still find it. Another use (which I find very useful) is to redirect to a longer URL, for example in my newsletters I can use a very short URL for my affiliate links. The following can be done to redirect a specific file:

Redirect /location/from/root/file.ext http://www.othersite.com/new/file/location.xyz />

In this above example, a file in the root directory called oldfile.html would be entered as:

/oldfile.html

and a file in the old subdirectory would be entered as:

/old/oldfile.html

You can also redirect whole directoires of your site using the .htaccess file, for example if you had a directory called olddirectory on your site and you had set up the same files on a new site at:
http://www.newsite.com/newdirectory/ you could redirect all the files in that directory without having to specify each one:

Redirect /olddirectory http://www.newsite.com/newdirectory />

Then, any request to your site below /olddirectory will bee redirected to the new site, with the
extra information in the URL added on, for example if someone typed in:

http://www.youroldsite.com/olddirecotry/oldfiles/images/image.gif />
They would be redirected to:

http://www.newsite.com/newdirectory/oldfiles/images/image.gif />
This can prove to be extremely powerful if used correctly.
Druckbare Seite  Sende diesen Artikel an einen Freund
[ zurück zu .htaccess | zurück zum Bereichsindex ]

 • Propaganda II



Suchen
Language
DeutschEnglishFrench
Translate
Neue Kommentare
 ·eXV2.org is forked
  I'm already in outs
 ·2.04 Viso - Indust
  This is a test comm
 ·FCKeditor File Upl
  ExV2 did not use fi
Neue Downloads
Download Yellow Pages Module
Du hast nicht die notwendigen Zugriffsrechte! Database: UML Sheet topic..
Du hast nicht die notwendigen Zugriffsrechte! E-Xoops language defines ..
Du hast nicht die notwendigen Zugriffsrechte! E-Xoops Function Referenc..
Du hast nicht die notwendigen Zugriffsrechte! E-Xoops Function Referenc..
Du hast nicht die notwendigen Zugriffsrechte! E-Xoops Function Referenc..
Du hast nicht die notwendigen Zugriffsrechte! E-Xoops defines
Du hast nicht die notwendigen Zugriffsrechte! E-Xoops Database Relation..
Du hast nicht die notwendigen Zugriffsrechte! E-Xoops Data Dictionary
Du hast nicht die notwendigen Zugriffsrechte! E-Xoops mainfile.php
Lexikon
XSD: XSD (XML Schema Definition), a Recommendation of the World Wide Web Consortium (W3C), specifies how to formally describe the elements in an Extensible Markup Language (XML) document. This description can be used to verify that each item of content ...
Login
Nickname

Passwort


Passwort vergessen?

Du hast noch keinen Account?
Registrieren ?
powered by AdSense
bamaGalerie3

Kategorie: Package II Rencontres Mondiales du Logiciel Libre
weitere Bilder
Neue Links
Partnerseiten

http://www.crawltrack.fr/

http://www.stapeliaart.de

http://www.picktools.de

http://www.rss-scout.de

http://www.e-xoopsfr.com

http://sourceforge.net/projects/exv2/

http://www.i-s-o.com