{"action":"created","issue":{"url":"https://api.github.com/repos/bcosca/fatfree/issues/813","labels_url":"https://api.github.com/repos/bcosca/fatfree/issues/813/labels{/name}","comments_url":"https://api.github.com/repos/bcosca/fatfree/issues/813/comments","events_url":"https://api.github.com/repos/bcosca/fatfree/issues/813/events","html_url":"https://github.com/bcosca/fatfree/issues/813","id":66561279,"number":813,"title":"Cyclic redirect 301/302 caused by trailing slash stripping","user":{"login":"dmig","id":388564,"avatar_url":"https://avatars.githubusercontent.com/u/388564?v=3","gravatar_id":"","url":"https://api.github.com/users/dmig","html_url":"https://github.com/dmig","followers_url":"https://api.github.com/users/dmig/followers","following_url":"https://api.github.com/users/dmig/following{/other_user}","gists_url":"https://api.github.com/users/dmig/gists{/gist_id}","starred_url":"https://api.github.com/users/dmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmig/subscriptions","organizations_url":"https://api.github.com/users/dmig/orgs","repos_url":"https://api.github.com/users/dmig/repos","events_url":"https://api.github.com/users/dmig/events{/privacy}","received_events_url":"https://api.github.com/users/dmig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-06T08:50:04Z","updated_at":"2015-04-06T10:46:31Z","closed_at":null,"body":"This reroute() call https://github.com/bcosca/fatfree/blob/master/lib/base.php#L1368 causes cyclic redirect under following circumstances:\r\n- project dir\r\n  - lib, ui, other dirs\r\n  - public dir\r\n    - public css, js, etc dirs\r\n    - admin dir (symlink actually)\r\n      - admin css, js, etc dirs\r\n    - index.html\r\n    - content.php\r\n    - .htaccess\r\n\r\nThis structure (public/admin/{css,js,img} and public/{css,js,img}) cannot be changed -- this static content shouldn't be mixed.\r\n\r\nHere is .htaccess\r\n```\r\nRewriteEngine On\r\n\r\nRewriteCond %{REQUEST_FILENAME} !/admin/(css|js|fonts|img)/\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteRule ^admin.* /content.php [L,QSA]\r\n\r\nRewriteRule ^media/content/content.json /content.php [L,QSA]\r\n```\r\nBASE value is autodetected.\r\n\r\nAccessing http://project/admin causes a cyclic redirect, which looks like this:\r\n![_2015-04-06_11-45-00](https://cloud.githubusercontent.com/assets/388564/7002384/66bf8594-dc52-11e4-8939-66751458859e.png)\r\n\r\nThis cycle is caused by two parties:\r\n1. web server (both apache and php internal server do this) kicks to url with trailing slash\r\n2. fatfree kicks to url without trailing slash\r\n\r\nSo, the question is: why fatfree does this redirect https://github.com/bcosca/fatfree/blob/master/lib/base.php#L1368 ? Isn't this wrong behavior?\r\n"},"comment":{"url":"https://api.github.com/repos/bcosca/fatfree/issues/comments/90014099","html_url":"https://github.com/bcosca/fatfree/issues/813#issuecomment-90014099","issue_url":"https://api.github.com/repos/bcosca/fatfree/issues/813","id":90014099,"user":{"login":"dmig","id":388564,"avatar_url":"https://avatars.githubusercontent.com/u/388564?v=3","gravatar_id":"","url":"https://api.github.com/users/dmig","html_url":"https://github.com/dmig","followers_url":"https://api.github.com/users/dmig/followers","following_url":"https://api.github.com/users/dmig/following{/other_user}","gists_url":"https://api.github.com/users/dmig/gists{/gist_id}","starred_url":"https://api.github.com/users/dmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmig/subscriptions","organizations_url":"https://api.github.com/users/dmig/orgs","repos_url":"https://api.github.com/users/dmig/repos","events_url":"https://api.github.com/users/dmig/events{/privacy}","received_events_url":"https://api.github.com/users/dmig/received_events","type":"User","site_admin":false},"created_at":"2015-04-06T10:46:31Z","updated_at":"2015-04-06T10:46:31Z","body":"Ok, and what about PHP internal server? It has same behavior.\r\nI think, `DirectorySlash Off` is not a correct solution.\r\n\r\nI suggest making \"internal\" redirect in such case -- modify $this->hive['URI'] (or it's local copy)."}}