Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:45:05+00:00 2026-06-01T04:45:05+00:00

I like the ability to automatically index a folder, so that I can serve

  • 0

I like the ability to automatically index a folder, so that I can serve a large number of files, without adding links to a page all the time. However I dislike the httpAuth login box that comes with using .htaccess to secure a directory. Plus there are more features I wanted on my indexes. So I have written a PHP script to generate indexes the way I want, so that I can control everything with PHP, store users in SQL, add extra links to my file editor, and log in with a nice looking web form.

The problem is any new directory needs an index.php file that includes the script, or I just get apache indexes. Which means copying a one line index.php file to every directory. I could generate it using PHP, but if I am working with FTP to manage files that will not solve all the problems. Is there any way to configure apache to display my index script in any directory that does not have an index files of its own? Such that it acts just like mod_autoindex? But with my custom script.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:45:06+00:00Added an answer on June 1, 2026 at 4:45 am

    Put the index.php in your root, then use redirect

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} -d #if directory exists
    RewriteRule . /index.php [L]
    

    Then inside index.php use $_SERVER['REQUEST_URI'] to figure out which folder was requested, then use PHP to display what you wanna display, e.g. using opendir, readdir, etc (don’t forget to handle the ‘.’ and ‘..’ unix files)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to have the ability to highlight a number and look it up
How can I add an index, to input names and ids in forms that
I'm stuck in .NET 2.0 Windows Forms. It doesn't look like the ability to
I'd like to have ability to resize pictures on my site. Algorithm: You upload
What I'd like is the ability to wrap a JavaScript property to modify behavior
It seems like Info.plist file has an ability to declare different roles for the
I would like to give the user the ability to insert custom elements in
I'd like to be able to give my users the ability to display their
Freemarker has the ability to do text escaping using something like this: <#escape x
I'd like to offer a user of my app the ability to highlight or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.