Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Quick Tip - Make Apache's Directory Indexes Look Nicer on Mobile

DZone's Guide to

Quick Tip - Make Apache's Directory Indexes Look Nicer on Mobile

· DevOps Zone
Free Resource

Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.

If you use Apache, then you most likely have DirectoryIndex enabled on your development server. This is the feature that lets you request a directory without a home document and see a list of folders and files. This is notnormally enabled in production, but in certain circumstances it may be. (For a file download directory perhaps.) If you do any testing with mobile devices though you will probably find this index to a be a bit hard to read. Here's an example.

You can pinch and zoom to make that a bit easier to read, but it's a pain in the rear. Turns out Apache has a few options that allow you to customize how this index file is created. One of them, IndexHeaderInsert, allows you to add HTML to the head section of the document. I added the following to my Apache httpd.conf file:

IndexHeadInsert "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"

And the result was exactly what I needed:

Hope this helps!


Download the ‘Practical Blueprint to Continuous Delivery’ to learn how Automic Release Automation can help you begin or continue your company’s digital transformation.

Topics:

Published at DZone with permission of Raymond Camden, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}