Im using IndexIgnore to deny file listing.
IndexIgnore *
IndexIgnore */*
Im tested all of them and nothing change but..
What different between of them :D
Thank you !!
IndexIgnore *
tells apache to Hide all files and dirs from the directory listing.
IndexIgnore */*
The line above tells apache to hide a spacific file or dir from the listing.
Examples :
* = All files a dirs.
*/* = Hides the root dir.
*foo.php* = hides /foo.php
Wildcard expression :
* = matches Any chars
*foo = matches a string starting with any chars followed by "foo".
file.* = matches a string starting with "file." followed by any chars.
Related
My .htaccess contains:
RewriteEngine on
RewriteBase /ss
RewriteRule ^(\w+)/?$ index.php?page=$1 [NC,L,QSA]
On clicking links for, or entering directly into the address bar, all of the following URLs, the result is that the address bar shows the same URL as was keyed in, and the code base processes the index.php page with the 'page' GET parameter (as expected):
//localhost/ss/help
//localhost/ss/help2
//localhost/ss/something
//localhost/ss/ss
//localhost/ss/sits
But the following URL has a different result. This URL:
//localhost/ss/sites
Results in the address bar displaying:
http://localhost/ss/sites/?page=sites
... however, it has still processed the index.php page with the GET parameter correctly. (The page styling is broken now because the link to the CSS is relative - and the presence of the "/sites/" node in the URL path breaks it.
What gives?
After turning on debug logging for mod_rewrite I then went through the steps of going to the following 3 URLs:
//localhost/ss/
//localhost/ss/help
//localhost/ss/sites
Below is a screen capture of the logging information. After that I explain the things I can see in the log file - I have put a letter next to each item in the screenshot.
A = lines relating to path /
B = lines relating to path /help
C = lines relating to path /sites
D = verify we are looking at path /help
E = verify we are looking at path /sites
F = last line for /help that is in common with processing for /sites
G = corresponding last line for /sites that is in common with /help
H = first block of lines for /help that are in common with /sites again
I = first block of lines for /sites that are in common with /help again
J = additional lines seen only when processing /sites
K = seemingly erroneous line - why would args show "page=sites&page=sites"?
Hopefully the log file helps.
I want to block in the htaccess URL file (https://www.example.com/files/example/index.html) for Google robots. Searching through the search engine I found something like:
RewriteEngine on
RewriteCond% {HTTP_USER_AGENT} Googlebot [OR]
RewriteRule ^. * $ "Http \: \ / \ / yordomain \ .com" [R = 301, L]
This file is for the domain, and I want to block a specific URL, how can I save it?
Why would you want to use it in htaccess??
Try using robots.txt Place the file with the code in the public_html folder.
User-agent: *
Disallow: /path/to/the/page/rate
Else you can make an, .htaccess file and save it in the public_html folder.
Check this post How to block Googlebot from accessing one specific page
The case is like below:
User-agent: *
Disallow: /
User-agent: Googlebot
Disallow: /test
In this case, is the Googlebot able to do its job?
I guess maybe since the file only specifies disallowing /test for the Googlebot, so there is a change that the Googlebot can do their jobs on other directories except for the /test?
question : In this case, is the Googlebot able to do its job?
answer : not this case
User-agent: *
Disallow: /
question : I guess maybe since the file only specifies disallowing /test for the Googlebot, so there is a change that the Googlebot can do their jobs on other directories except for the /test?
answer : yes exactly
a while ago i was using htaccess to display some files, and recently i started that project again and found i had somehow deleted the "go up a level" button back then.
Can anyone tell me what the code line in htaccess looks like to get this button back? Should be relatively simple but i just cant find it... heres what i got.
Options +Indexes
# DIRECTORY CUSTOMIZATION
<IfModule mod_autoindex.c>
IndexOptions IgnoreCase FancyIndexing FoldersFirst NameWidth=* DescriptionWidth=* SuppressHTMLPreamble
# SET DISPLAY ORDER
IndexOrderDefault Descending Name
# SPECIFY HEADER FILE
HeaderName /partials/header.html
# SPECIFY FOOTER FILE
ReadmeName /partials/footer.html
# IGNORE THESE FILES, hide them in directory
IndexIgnore ..
IndexIgnore header.html footer.html icons
# IGNORE THESE FILES
IndexIgnore header.html footer.html favicon.ico .htaccess .ftpquota .DS_Store icons *.log *,v *,t .??* *~ *#
# DEFAULT ICON
DefaultIcon /icons/generic.gif
AddIcon /icons/dir.gif ^^DIRECTORY^^
AddIcon /icons/pdf.gif .txt .pdf
AddIcon /icons/back.png ..
</IfModule>
Options -Indexes
Okay found the problem, it was simple, just not very observant when looking at the code. The line "IndexIgnore .." roughly in the middle.
I have a directory with an .htaccess file having the setting IndexIgnore *. How can I set a subdirectory to not ignore anything, or to ignore the negation of everything, so as to override the parent directory's IndexIgnore? Like IndexIgnore ^*, only a working version thereof?
Simply add IndexIgnoreReset ON before the new IndexIgnore directive.
And then, to show everything in the sub folder use IndexIgnore "."
Check the documentation at:
IndexIgnoreReset
I don't think it will be possible because IndexIgnore list is always appended in the existing list (from parent .htaccess). There is now way to overwrite this directive AFAIK.
In <Directory> block you can add:
IndexIgnoreReset ON
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
This will override config for this specific <Directory>