Prevent Directory Listing Prevenire l'elenco directory
January 31st, 2007 · by David Bradley 31 gennaio 2007 da David Bradley
If you followed my advice to move from Blogspot to your own domain hosted Wordpress blog, then you may have noticed (depending on how your new host server is set up) that opening certain directories produces not the page you were expecting, but a listing of the contents of that directory. Se avete seguito il mio consiglio di passare da Blogspot per il tuo dominio ospitato Wordpress blog, quindi avrete notato (a seconda di come il vostro nuovo server host è impostato su) che l'apertura alcune directory non produce la pagina ti aspettavi, ma una lista di il contenuto di quella directory.
Now, that’s not usually a problem for most users, it just generates an ugly directory that makes your site look unprofessional. Ora, questo non è di solito un problema per la maggior parte degli utenti, è solo genera un brutto directory che fa guardare il tuo sito non professionale. However, it can expose file and folder names on your server that you don’t want visitors to browse and read. Tuttavia, può esporre nomi di file e cartelle sul server che non si desidera ai visitatori di sfogliare e leggere.
There is a very quick fix for this. È molto veloce correzione per questo.
Open your .htaccess file (usually in the root folder or public_html) Apri il tuo. Htaccess file (di solito nella cartella principale o public_html)
near the top simply enter the following line of code and save the file. nella parte superiore semplicemente digitare la seguente riga di codice e salvare il file.
IndexIgnore * IndexIgnore *
Now, when you try to open that “directory listing” it won’t display the folder’s contents. Adesso, quando si tenta di aprire che "directory" non visualizzare il contenuto della cartella.
If you don’t want to block all browsing, just gifs and jpgs or zip files for instance, then use the following syntax instead: Se non si vuole impedire a tutti la navigazione, e solo Gifs jpgs o file zip per esempio, quindi utilizzare la seguente sintassi invece:
IndexIgnore *.gif *.jpg IndexIgnore *. gif *. jpg
IndexIgnore *.zip IndexIgnore *. zip
IndexIgnore *.mp3 IndexIgnore *. mp3
(You get the picture) (Vedrete la foto)
Conversely, you might actually want to allow browsing of directories, but it’s disabled on your host by default. Per converso, si potrebbe effettivamente desidera consentire la navigazione delle directory, ma è disattivato sul vostro host di default. Again, it’sa .htaccess issue, see if IndexIgnore is already in there and delete it, if not enter this line instead: Anche in questo caso, si tratta di un. Htaccess problema, IndexIgnore vedere se è già in là e eliminarlo, se non entrare in questa linea, invece:
Options +Indexes Opzioni + Indici
That opens up directory listing for the root folder (and/or any other folders in which you have a .htaccess file). Che apre l'elenco directory per la cartella principale (e / o di qualsiasi altra cartelle in cui si ha una. Htaccess file).
However, even that is not a particularly elegant solution. Tuttavia, anche questa non è una soluzione particolarmente elegante. What I was finding till I did the following tweak was that Wordpress was displaying the contents of the feed folder rather than displaying the feed. Ciò che mi è stato fino a trovare ho fatto la seguente ottimizzare Wordpress che è stato è stato la visualizzazione del contenuto della cartella dei mangimi piuttosto che di visualizzare il feed. So, here’s the solution that makes a click on that directory do the right thing. Quindi, ecco la soluzione che fa un clic su un elenco che fare la cosa giusta. Open CPanel and navigate to your Index Manager. CPanel aperto e navigare verso la Index Manager. Click the feed folder (or whichever folder you want to block directory listing of) and choose “No Indexes”. Fare clic sulla cartella mangimi (o qualsiasi cartella che si desidera bloccare lista di directory) e scegliere "No Indici". That got my rss feed for this site working properly, and if applied to other folders too prevents directory listings and spawns a 403 error page, which can be customized. Che ha ottenuto il mio feed RSS per questo sito funziona correttamente e, se applicata ad altre cartelle troppo impedisce elenchi di directory e lancia uno pagina di errore 403, che può essere personalizzato. More on custom 404 and 403 pages another time Maggiori informazioni su personalizzato 404 e 403 pagine di un altro tempo

















0 responses so far ↓ 0 risposte finora ↓
Got something to say? Hai qualcosa da dire? Start a comment thread here. Avviare un commento thread qui. Top commentators get a FREE link on the homepage! Top commentatori LIBERA ottenere un link sulla home page!
Leave a Comment Lascia un commento