{"action":"created","issue":{"url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/111","repository_url":"https://api.github.com/repos/sebsauvage/MinigalNano","labels_url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/111/comments","events_url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/111/events","html_url":"https://github.com/sebsauvage/MinigalNano/issues/111","id":148742551,"number":111,"title":"URL rewriting","user":{"login":"jmbelloteau","id":10623367,"avatar_url":"https://avatars.githubusercontent.com/u/10623367?v=3","gravatar_id":"","url":"https://api.github.com/users/jmbelloteau","html_url":"https://github.com/jmbelloteau","followers_url":"https://api.github.com/users/jmbelloteau/followers","following_url":"https://api.github.com/users/jmbelloteau/following{/other_user}","gists_url":"https://api.github.com/users/jmbelloteau/gists{/gist_id}","starred_url":"https://api.github.com/users/jmbelloteau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmbelloteau/subscriptions","organizations_url":"https://api.github.com/users/jmbelloteau/orgs","repos_url":"https://api.github.com/users/jmbelloteau/repos","events_url":"https://api.github.com/users/jmbelloteau/events{/privacy}","received_events_url":"https://api.github.com/users/jmbelloteau/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/sebsauvage/MinigalNano/milestones/2","html_url":"https://github.com/sebsauvage/MinigalNano/milestones/1.0","labels_url":"https://api.github.com/repos/sebsauvage/MinigalNano/milestones/2/labels","id":859358,"number":2,"title":"1.0","description":"miniGal is now stable","creator":{"login":"tmos","id":1592709,"avatar_url":"https://avatars.githubusercontent.com/u/1592709?v=3","gravatar_id":"","url":"https://api.github.com/users/tmos","html_url":"https://github.com/tmos","followers_url":"https://api.github.com/users/tmos/followers","following_url":"https://api.github.com/users/tmos/following{/other_user}","gists_url":"https://api.github.com/users/tmos/gists{/gist_id}","starred_url":"https://api.github.com/users/tmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmos/subscriptions","organizations_url":"https://api.github.com/users/tmos/orgs","repos_url":"https://api.github.com/users/tmos/repos","events_url":"https://api.github.com/users/tmos/events{/privacy}","received_events_url":"https://api.github.com/users/tmos/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2014-11-09T22:37:05Z","updated_at":"2016-07-05T11:19:27Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-04-15T19:03:46Z","updated_at":"2016-07-05T11:22:29Z","closed_at":null,"body":"Hello,\r\n\r\nFor best SEO and beautiful link I made some url rewriting with .htaccess and it's working perfectly when manually writing the modify URL in the address bar.\r\n\r\nNow I need to modify the MinigalNano main code to generate folders links with the modified links structure. I really try a lot for one week now, and I can't found the solution but impossible to found the solution. Can Someone help me?\r\n\r\n**here are the link structure of MinigalNano :**\r\nhttp://localhost:8888/photos.php?dir=land%2Fabstract%2Ftest\r\n\r\n**what I want :**\r\nhttp://localhost:8888/photos/land/abstract/test/\r\n\r\n**the URL rewriting rules (working) :**\r\n```\r\n# REWRITE PHOTOS\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !-d\r\nRewriteRule ^photos/(.*)/$ /photos.php?dir=$1 [L]\r\nRewriteRule ^photos/(.*)/(.*)/(.*)/$ /photos.php?dir=$1%2F$1%2F$3 [L]\r\n```\r\n\r\n\r\n**the PHP code of Minigal that generate folder link to modify :**\r\n```\r\n//-----------------------\r\n// READ FILES AND FOLDERS\r\n//-----------------------\r\n\r\n$files = array();\r\n$dirs = array();\r\n$img_captions = array();\r\nif (is_dir($currentdir) && $handle = opendir($currentdir)) {\r\n    // LOAD CAPTIONS\r\n    while (false !== ($file = readdir($handle))) {\r\n        // LOAD FOLDERS\r\n        if (is_dir($currentdir . \"/\" . $file)) {\r\n            if ($file != \".\" && $file != \"..\") {\r\n                // FIRST IMAGE BG\r\n                unset($firstimage);\r\n                $firstimage = getfirstImage(\"$currentdir/\" . $file);\r\n                $linkParams = http_build_query(\r\n                    array('dir' => ltrim(\"$requestedDir/$file\", '/')),\r\n                    '',\r\n                    '&amp;'\r\n                );\r\n                $linkUrl = \"$autogal_page_name?$linkParams\";\r\n\r\n                $imgParams = http_build_query(\r\n                    array(\r\n                        'filename' => \"$thumbdir/$file/$firstimage\",\r\n                        'size' => $thumb_size),\r\n                    '',\r\n                    '&amp;'\r\n                );\r\n                $imgUrl = GALLERY_ROOT . \"createthumb.php?$imgParams\";\r\n\r\n                $dirs[] = array(\r\n                    \"name\" => $file,\r\n                    \"date\" => filemtime($currentdir . \"/\" . $file),\r\n                    \"html\" => \"<div class=\\\"thumbs\\\"><a href=\\\"{$linkUrl}\\\"><div class=\\\"caption\\\"><div class=\\\"flowtype_gallery\\\"><h1>\" . $file . \"</h1></div><div class=\\\"caption_overlay\\\"></div></div><img src=\\\"{$imgUrl}\\\"  alt='$label_loading' /></a></div>\",\r\n                );\r\n            }\r\n        }\r\n\r\n        // LOAD FILES\r\n        if ($file != \".\" && $file != \"..\") {\r\n            if (preg_match(\"/.jpg$/i\", $file)) {\r\n                //Read EXIF\r\n                $exifReaden = readEXIF($currentdir . \"/\" . $file);\r\n                $img_captions[$file] = $file . $exifReaden;\r\n                //Link\r\n                $linkUrl = str_replace('%2F', '/', rawurlencode(\"$currentdir/$file\"));\r\n                $imgParams = http_build_query(\r\n                    array(\r\n                        'filename' => \"$thumbdir/$file\",\r\n                        'size' => $thumb_size),\r\n                    '',\r\n                    '&amp;'\r\n                );\r\n                $imgUrl = GALLERY_ROOT . \"createthumb.php?$imgParams\";\r\n                $files[] = array(\r\n                    \"name\" => $file,\r\n                    \"date\" => filemtime($currentdir . \"/\" . $file),\r\n                    \"size\" => filesize($currentdir . \"/\" . $file),\r\n                    \"html\" => \"<div class=\\\"thumbs\\\"><a href=\\\"{$linkUrl}\\\"><div class=\\\"caption\\\"><div class=\\\"flowtype_gallery\\\"><h1><i class=\\\"ion-ios-plus-empty\\\"></i></h1></div><div class=\\\"caption_overlay\\\"></div></div><img class=\\\"lazyload\\\" src=data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== data-src=\\\"$imgUrl\\\" alt=\\\"$label_loading\\\" title=\\\"\" . htmlentities($img_captions[$file]) . \"\\\" /></a></div>\");\r\n            }\r\n        }\r\n    }\r\n    closedir($handle);\r\n} else {\r\n    die(\"ERROR: Could not open \" . htmlspecialchars(stripslashes($currentdir)) . \" for reading!\");\r\n}\r\n```\r\n\r\n\r\nThank you so much\r\n\r\nJim"},"comment":{"url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/comments/230452612","html_url":"https://github.com/sebsauvage/MinigalNano/issues/111#issuecomment-230452612","issue_url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/111","id":230452612,"user":{"login":"tmos","id":1592709,"avatar_url":"https://avatars.githubusercontent.com/u/1592709?v=3","gravatar_id":"","url":"https://api.github.com/users/tmos","html_url":"https://github.com/tmos","followers_url":"https://api.github.com/users/tmos/followers","following_url":"https://api.github.com/users/tmos/following{/other_user}","gists_url":"https://api.github.com/users/tmos/gists{/gist_id}","starred_url":"https://api.github.com/users/tmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmos/subscriptions","organizations_url":"https://api.github.com/users/tmos/orgs","repos_url":"https://api.github.com/users/tmos/repos","events_url":"https://api.github.com/users/tmos/events{/privacy}","received_events_url":"https://api.github.com/users/tmos/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T11:22:29Z","updated_at":"2016-07-05T11:22:29Z","body":"Will be implemented after the refactor as an option :)"}}
{"actor":{"display_login":"tmos"}}