November 18, 201411 yr I want to make a url show a list of the subdirectories in that domains folder and of cuorse with out the option to go back behind that folder so people can't mass with my files... I will try to be more clear: I have, lets say this domain: tests.domain.com and in that domain i have a lot of folders of websites i'm working on: tests.domain.com/TestWebsite1/ tests.domain.com/TestWebsite2/ tests.domain.com/TestWebsite3/ tests.domain.com/TestWebsite4/ And so on... So i want that when i'm going to 'tests.domain.com' it will show me those sub-folders so when i click on them it will take me to this test website... Any idea how to do that? Thanks.
November 18, 201411 yr Is this just for your own personal use or for public / client facing? Is this local hosted or online?
November 18, 201411 yr Ok, I would suggest setting up the main root as password protected or lock it by IP address depending what's better for your situation. Set the robots.txt to disallow all which will stop the whole thing being indexed. Inside the root you can allow indexing of folders with htaccess (see http://stackoverflow.com/questions/12646668/allow-access-to-certain-directories-in-htaccess). Then inside each of the site folders so long as it has an index file the sites will automatically appear when a folder is clicked. There are probably other ways to do this, no doubt someone on here will know a better way.
November 18, 201411 yr Author That's a simple and a great idea from what i get. how can i make this url password protected? Thanks!
November 18, 201411 yr Author Thanks. So i'm trying, i have in this main domain folder only the subfolders and two files: 1. htaccess 2. htpasswd Bothe generated by this generator you linked, but when i go to the url it says: Forbidden You don't have permission to access / on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
November 18, 201411 yr Directory index in the htaccess file, see https://support.tigertech.net/directory-index Also see http://www.htaccesstools.com/htaccess-authentication/ htaccess is powerful, see http://htaccess-guide.com/ Edited November 18, 201411 yr by BrowserBugs
November 18, 201411 yr Author if i add the line: Options +Indexes to the .htaccess file it shows the folders but doesn't ask for password...
November 18, 201411 yr Hmm they might not like direct linking, http://www.htaccesstools.com/ and look for HT Access Authentication ... the last link to htaccess-guide.com has all covered.
Create an account or sign in to comment