Posts: 7
Threads: 4
Joined: Aug 2009
I am reviewing the code and find this fragment in index.php:
Code:
// redirect to ignore homepage called as /index/
if (tsl($_SERVER['PHP_SELF']) == '/index/' ) { header('Location: '. $SITEURL ); exit; }
What is this used for?
Thanks.
Posts: 111
Threads: 14
Joined: Jan 2010
It's checking to see if the user put:
http://mysite.com/index or index/ and if they did just redirect them to
http://mysite.com
Posts: 7
Threads: 4
Joined: Aug 2009
Nijikokun Wrote:It's checking to see if the user put: http://mysite.com/index or index/ and if they did just redirect them to http://mysite.com
Sorry, I guess I didn't ask the right question.
Why is the code there?
We are already executing the index.php code so why redirect back to ourselves -- which will then just execute index.php again -- right?
Is there a security issue? What am I missing?
Thanks,
~Joe
Posts: 1,848
Threads: 86
Joined: Aug 2009
it should take care of duplicate content. This has never caused a loop in the install.
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 67
Threads: 11
Joined: Aug 2009
2010-02-05, 18:40:19
(This post was last modified: 2010-02-05, 18:40:37 by lona79.)
ccagle8 Wrote:it should take care of duplicate content. This has never caused a loop in the install.
Yes, but it gives me some 500 error on some sites !
Will post soon a solution (i am looking to my logs to understand what happened).
Sharing is human real nature...
Posts: 1,848
Threads: 86
Joined: Aug 2009
thanks superyms - i've never seen a problem with it, or at least one has never been reported, so i am interested what you find out.
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 111
Threads: 14
Joined: Jan 2010
I only see it sending a loop if you put the cms in a directory named /index/
Posts: 7
Threads: 4
Joined: Aug 2009
I hope I'm not beating a dead horse here but I am new to the GS.
I am trying to understand the internals so I am looking at the logic decisions behind the design.
Can you give me an example of a URL a user would call that would generate a different result depending on if the
Code:
if (tsl($_SERVER['PHP_SELF']) == '/index/' ) { header('Location: '. $SITEURL ); exit; }
code is active or commented out?
~Joe
Posts: 1,848
Threads: 86
Joined: Aug 2009
without Fancy URLS, the query string is index.php?id=index, with Fancy URLs on, it is /index/ (it just replaces the ID with the page slug) - in this case it is the homepage or index page.
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 111
Threads: 14
Joined: Jan 2010
It's fancy urls that's causing your 500 error. I ran into today with this girl.
Posts: 67
Threads: 11
Joined: Aug 2009
Nijikokun Wrote:It's fancy urls that's causing your 500 error. I ran into today with this girl.
I confirm Fancy URL caused 500 errors.
Sharing is human real nature...
Posts: 1,848
Threads: 86
Joined: Aug 2009
I'm running GS 2.0 w/fancy urls on and Im not seeing this error? What are the circumstances that we see the 500 error?
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 111
Threads: 14
Joined: Jan 2010
2010-02-07, 05:23:26
(This post was last modified: 2010-02-07, 05:24:01 by martynas.barzda.)
ccagle8 Wrote:I'm running GS 2.0 w/fancy urls on and Im not seeing this error? What are the circumstances that we see the 500 error?
It worked in a sub directory, however on root it started displaying a 500 error. I fixed it by turning off fancy urls. If placed back into a sub directory it worked again.
This is on someone else's host and not mine, I have no idea what was causing it.
Posts: 1,848
Threads: 86
Joined: Aug 2009
with the latest revision that will be in 2.01 this line of code can likely be removed. It was there because sometimes I would see a page with /index/ in the url... but I have since centralized all URL creation under a new function that should NEVER return a URL like domain.com/index/
looks like with the CKEditor and these slug problems (that were probably there the whole life of this CMS) we will be releasing 2.01 soon...
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 78
Threads: 16
Joined: May 2010
I would like to bring this issue (500 errors with Use Fancy URLs on) into the present. Please bear with me:
I installed GS30 in sub-directory (something else was at the root at the time.)
I removed root application and installed GS30 there.
Migrated files and settings to the new installation. (I had paid special attention to the Base URL, etc.)
Now my Home page (index) works, but any pages or sub-pages throw the 500 with Use Fancy URLs on.
Looks like there must be something relative to the old sub-dir installation lurking.
My first thought was that it was in the page XML, so I trashed everything except the index which worked. Recreated the first page and the 500 showed up.
Must be deeper. Any ideas?
Posts: 524
Threads: 48
Joined: Mar 2011
snooze Wrote:I would like to bring this issue (500 errors with Use Fancy URLs on) into the present. Please bear with me:
Migrated files and settings to the new installation. (I had paid special attention to the Base URL, etc.)
How does your .htaccess file look like? Maybe we can spot something there, otherwise it's mere guesswork.
Posts: 78
Threads: 16
Joined: May 2010
Thorsten lead me there and I found the problem.
Path other than the root left over from my previous installation in sub-dir.
Thanks
Posts: 524
Threads: 48
Joined: Mar 2011
snooze Wrote:Path other than the root left over from my previous installation in sub-dir.
It's often those little things with a huge impact. Keep rocking with GS! \m/