Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
directory contents showed instead if GS page
#1
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.
Reply
#2
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 …
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#3
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.
Reply
#4
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/
Reply




Users browsing this thread: 1 Guest(s)