GetSimple Support Forum

Full Version: directory contents showed instead if GS page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If there is a directory with the same name as a page in GS, its content will be showed rather than the page.

For example:
create a dir named "download" on GS path.
create a file in GS and name the slug/url "download"

If you navigate to "localhost/download" it will show the contents of "download" directory.
That’s the whole idea with GetSimple, the system takes all unexisting URLs (when Fancy URLs are turned on) and tries to parse them. If a URL points to an existing thing it will never try to parse that URL through GetSimple.

You could “fix” this by changing the HTACCESS-file, take these rows away:
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
They tell the server to only parse URLs when files do not exist. Without these rows ALL URLs will be parsed. I don’t know whether this will break anything else though …
kcsoft Wrote:If you navigate to "localhost/download" it will show the contents of "download" directory.

If your server allows directory listing (nothing strange), that will happen with any directory that has no default index file (index.html, index.htm, index.php, etc.) inside: a list of files will be shown even if GetSimple is not installed.

To fix this you can create an empty index.html file in the directory.
kcsoft Wrote:If there is a directory with the same name as a page in GS, its content will be showed rather than the page.

I find this a feature, :-) not a problem. It gives the possibility to easily add links in the site menus to other pages in the site that aren't created/managed with GetSimple but share the same directory (or are in subdirectories).

To avoid problems with a user creating a page with the same slug as a directory, you could use some "_" character in the directory's name:

SITE/_download/
SITE/download_folder/