Hits by Directory


Do you want to track which directories get the highest traffic in your web site ?

AWStats provides several ways to filter URL’s, but, to filter by directory, you need to add this Extra Section to your AWStats config file (awstats.your-domain-name.conf).

New Report

AWStats, hits by directory
This AWStats screen has been simulated for better readability.

Extra Section

ExtraSectionName1="Hits by Directory"
ExtraSectionCodeFilter1="200 304"
ExtraSectionCondition1="URL,^.*$"
ExtraSectionFirstColumnTitle1="Directory"
ExtraSectionFirstColumnValues1="URL,^\/([^\/]*)\/"
ExtraSectionFirstColumnFormat1="<A HREF='/%s/' TARGET='_blank'>%.80s</A>"
ExtraSectionStatTypes1=PHB
ExtraSectionAddSumRow1=1
MaxNbOfExtra1=10
MinHitExtra1=1

MaxNbOfExtra1 is the number of lines that will be listed. Use the most convenient value.

7 Responses to “Hits by Directory”

  1. Jebamani says:

    will this recognize rewritten url’s or works only for physically present folders?

  2. Jean-Luc says:

    This extra section works with rewritten URL’s too. “Virtual” folders will appear in the report like “physical” folders do.

    Jean-Luc

  3. Gabi says:

    Hi,
    I wonder why “Pages” and “Hits” in ExtraSection are always the same. If “Pages” are just the pure htm-file and “Hits” are the htm-file with its images and so on, these numbers should differ. And when you use the filter from “Pages-URL (Top 10)” you can see, that both numbers must be “Hits”. But in ExtraSection “Pages” make more sense to me. Is this a bug or is there something I do not understand?

    Gabi

  4. Jean-Luc says:

    Hi Gabi,

    Pages and hits are not always the same in extra sections.

    The regular expressions used in some extra sections exclude files that are not pages. These extra sections will show the same numbers for pages and hits. In this case, you should use :
    ExtraSectionStatTypes1=PB

    Other extra sections show different numbers for pages and hits. In the example above, you see that the first directories only include pages and that the last one contains images and no page.

  5. vicky9 says:

    Using this Extra section m able to list the directories like my website is.www.abc.com and some dir are in ways like www.xyz.com/pt/ and another is www.xyz.com/kt/, after using this Extra section m getting list n count for Dir:pt and kt but now m looking for pages in these dir…?

    like if I have www.abc.com/pt/login.html www.abc.com/pt/report.html ::Can I get the individual page report in different rows one row is for report.html and another is for login.html..?

    is it possible to customize the report using business friendly name like my page report.html should be like MF Report (User friendly name in one column) and /pt/report.html (Url in another column) or business friendly name should be an hyperlink for page:/pt/report.html..?

    Question moved to our forum about Extra Sections: Hits on pages within a directory.

  6. Richard says:

    Thanks for the new report. It looks very useful. I was able to implement into my .conf file and get results. Unfortunately I am analysing a IIS log from sharepoint. Therefore the top 10 directories are meaningless names like /c11/ etc. How can I modify the parameters in the code to report on the directories at the next level down instead?

  7. Jean-Luc says:

    Hi Richard,

    Try this:
    ExtraSectionFirstColumnValues1="URL,^\/([^\/]*\/[^\/]*)\/"


 

Leave a Reply

You must be logged in to post a comment.