Join GitHub today
trailing slash is required on URL #855
Installed on my local dev server, on Windows 7 - I've had 2 issues where trailing slashes were required to get pages to display without getting a consistent and repeatable 403 Forbidden error.
I tried adding a section to the top of .htaccess to force a DirectoryIndex handler and disable MultiView, but that was no help. The 403's reappear if I try to open the site without the slash.
Since the site code never even gets a chance to execute, there are no debug messages, console errors, or any logs to check.
Ultimately this would be moved to a proper subdomain on a production Linux server, so I don't think it will be an issue when everything is in document-root, but as it is now, I have to remember to add the slash if I get a 403.
Well I'm truly stumped now. I thought I'd try out a 2nd install to find out if the slash was all I'd missed on the earlier install that failed to load any start page. I used the exact same zip file I'd downloaded and had used before, on the exact same dev server, and used another subfolder just as I did before - except I named it '/pagekit-2'.
I typed in the URL in FireFox without the trailing slash, and watched as the trailing slash was added to the URL, and the page flipped over to the '/installer' directory - and soon after, up popped the bouncing arrow page. I tried the same in Chrome, with exactly the same result. I went back to FireFox and completed a new install without a hitch. I also got logged in without error, and displayed the home page too - with a trailing slash being added automagically. I again went back to Chrome to try the home page on the completed install, and got the automatic slash and a viewable page.
It's not for trying, since I expected the same outcome and I'd consciously followed the same steps as before. My system hasn't changed in 24 hours and I'd certainly made no code changes before trying, so I have no real clue why the 2nd attempt worked when the 1st did not. The odd part is that the original install still requires the manual addition of the slash, while the 2nd doesn't. Could it be the use of the word "pagekit" as a directory name that was enough to cause the issue? Again... no idea, just grasping for possibilities.
I think I'll switch over to using the 2nd install as a dev site - just in case.
If it would be of any use, I can always zip up the site and post it for one of the devs to grab. It's not impossible that 7zip managed to mangle something during the extraction, and it could even be Win 7 doing something whacky - it has before, and will probably do it again. That's not to say that I couldn't have inadvertently mucked something up too, but I rarely screw up the simple stuff after 35+ years of IT work.
I'm just glad that the 2nd install went well and it's behaving as expected so far. The planned site is a small information-type subdomain, and Pagekit would work well for what's needed... so unless a real show-stopper pops up, it's got the job at the moment.
This happens because of the first block in .htaccess
If you look in the condition for the FilesMatch, you can see the or condition for the pagekit CLI executable, at the very end.
So, in essence, you cannot run pagekit in a directory named pagekit. If you change that folder to any other compatible name, or add a slash to throw off the FilesMatch condition, you'll be just fine.