.htaccess - Custom directory viewer (php) -


i started little project few days ago, directory viewer. (not redesigned htaccess thing.)

it's written in php , works great except few little things.

i have 1 file (masterfile) parts of viewer (css, php, ..) come , build final viewer. whenever access directory without index.php, index.html, etc. in it, should end in masterfile , see directory (-content).

example: example.com/css/ => you're in css dir => show custom dir viewer (css folder)

idea: disable .htaccess indexing produces 403 error, redirect error masterfile.

options -indexes errordocument 403 /masterfile.php 

this work, lists content of masterfile directory , not content original folder (example: /css/) ideas?

possible solution (i don't like): put file, includes "masterfile", in every directory , name index.php

i hope guys have ideas, appreciate help!

you can put @ top of masterfile.php:

$parsed = parse_url($_server['request_uri']); $files = scandir($_server['document_root'].$parsed['path']); 

maybe adjustment depending of server configuration. parse_url stuff remove eventual get and/or segments.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -