Thursday, May 12, 2016

Show Hidden File on CPanel for any Web Host

cPanel Example

So here is the situation.  You've purchased inexpensive web hosting.  Like most hosts, they use cPanel to setup your website.  cPanel even lets you browse your web files directly.  But after using it for some time(or perhaps, even from the beginning) the file browser won't show your hidden files - those files that start with a period(.).

This is disastrous, the .dot files are where you can do advanced configuration for your website, but you don't see any of them.  You google it and there are some instructions for a few web hosts. Unfortunately, you can't find your host, the instructions didn't work, or the instructions require resetting your carefully cultivated settings.

If this has ever happened to you, here is the simple way to show your hidden files within the cPanel FileBrowser.  The procedure is simple enough.

The Procedure

Step 1. Open up the FileBrowser

Step 2. Look at the url for the page you're on. (That's the long text at the top of your browser, but you probably knew that being a webmaster.)

Example URL for the cPanel File Browser

Step 3. Add the following text to the end of the url "&showhidden=1" so it looks like below

Alternative step 3) If the url contains the text "&showhidden=0" then we just need to modify it.  Change the "0" or "false" to "1".
Step 4. Press Enter (so as to reload the page)

Voila!  The file browser will now show all of your hidden files.

Why does this work?

In case the procedure above doesn't work, i will go into some detail of what it is we are doing in the procedure  That way, it may help you solve your problem.

So, what is going on here? Websites as advanced as cPanel often use what are called "Get parameters" or "Get variables".  They can do anything from configuration, keeping track of you, or provide other options for rendering.

These "get parameters" are easy to see.  They will be in the url.  They always have the following format.  After the rest of the URL there will be a question mark(?) to indicate the beginning of the "Get Parameters". After the question mark will be the name of the parameter, an equal sign, and then the value.  If there are more than 1 Get Parameter in a url they will be separated by a ampersand(&).  A value for a Get Parameter can be text, like "Game-of-Thrones" or can be a number like "314" or "1.34".

Together it all has the following layout
[first part of url]?[firstParameterName]=[firstParameterValue]&[secondName]=[secondValue]&etc
So when you add the text &showhidden=1, you are telling cPanel that the value of "showhidden" is "1" for the page you are loading.  But, you may ask, why set it to "1"?  That doesn't make any sense!  Here's the explanation:

The parameter showhidden is called a "boolean" value. That's jargon meaning the only values it can be is "true" or "false". For arcane and historical reasons, programs can also use "0" to mean false and "1" to mean true.  So when we set showhidden=1 what we are telling cPanel is showhidden=true. Which is a true statement. It is true that we want cPanel to show hidden files.

Hope this article was helpful!
Leave a Comment