http://atutor.ca/atutor/mantis/view.php?id=4659
authorharris wong <hwong@ocad.ca>
Wed, 15 Dec 2010 22:12:28 +0000 (22:12 -0000)
committerharris wong <hwong@ocad.ca>
Wed, 15 Dec 2010 22:12:28 +0000 (22:12 -0000)
docs/.htaccess
docs/include/classes/UrlRewrite/UrlRewrite.class.php

index 0b4ec2d..a5557b6 100644 (file)
@@ -91,9 +91,14 @@ RewriteCond     %{REQUEST_FILENAME}     !-f
 RewriteCond     %{REQUEST_FILENAME}     !-d
 RewriteRule ^([^/]+)/([^/^.]+)/?$ go.php/$1/$2.php [L]
 
+#This handles multi-level directory (adds index.php to the add if it ends with a /)
 RewriteCond     %{REQUEST_FILENAME}     !-f
 RewriteCond     %{REQUEST_FILENAME}     !-d
-RewriteRule ^([^/]+)/(((mods)/[^/^.]+)|([^/^.]+))/([^/^.]+)/?$ go.php/$1/$2/$6.php [L]
+RewriteRule ^([^/]+)/(([^/^.]+)/)+([^/^.]+)/$ go.php/$1/$2/$4/index.php [L]
+
+RewriteCond     %{REQUEST_FILENAME}     !-f
+RewriteCond     %{REQUEST_FILENAME}     !-d
+RewriteRule ^([^/]+)/([^/^.]+)/([^/^.]+)/?$ go.php/$1/$2/$3.php [L]
 
 RewriteCond     %{REQUEST_FILENAME}     !-f
 RewriteCond     %{REQUEST_FILENAME}     !-d
index 6d2d652..c7063d4 100644 (file)
@@ -323,28 +323,30 @@ class UrlRewrite  {
        function getPath(){
                //for 2.0, most of the paths are moved  into mods/_standard
                //map the paths.
-               $hmap = array (                                                                                                                 
-                                       '/glossary'             =>      'mods/_core',
-                                       '/groups'               =>      'mods/_core',
-                                       '/imscp'                =>      'mods/_core',
-                                       '/blogs'                =>      'mods/_standard',
-                                       '/chat'                 =>      'mods/_standard',
-                                       '/directory'    =>      'mods/_standard',
-                                       '/faq'                  =>      'mods/_standard',                                       
-                                       '/file_storage' =>      'mods/_standard',
-                                       '/forums/forum' =>      'mods/_standard',
-                                       '/google_search'=>      'mods/_standard',
-                                       '/gradebook'    =>      'mods/_standard',
-                                       '/links'                =>      'mods/_standard',
-                                       '/photos'               =>      'mods/_standard',
-                                       '/polls'                =>      'mods/_standard',
-                                       '/sitemap'              =>      'mods/_standard',
-                                       '/social'               =>      'mods/_standard',
-                                       '/student_tools'=>      'mods/_standard',
-                                       '/tile_search'  =>      'mods/_standard',
-                                       '/tests'                =>      'mods/_standard',
-                                       '/tracker'              =>      'mods/_standard',
-                                       '/reading_list' =>      'mods/_standard'                                        
+        //TODO: Add regex into the path, ie. /social/* means all folders under social.
+        $hmap = array (
+                    '/glossary'                =>      'mods/_core',
+                    '/groups'          =>      'mods/_core',
+                    '/imscp'           =>      'mods/_core',
+                    '/blogs'           =>      'mods/_standard',
+                    '/chat'                    =>      'mods/_standard',
+                    '/directory'       =>      'mods/_standard',
+                    '/faq'                     =>      'mods/_standard',
+                    '/file_storage'    =>      'mods/_standard',
+                    '/forums/forum'    =>      'mods/_standard',
+                    '/google_search'=> 'mods/_standard',
+                    '/gradebook'       =>      'mods/_standard',
+                    '/links'           =>      'mods/_standard',
+                    '/photos'          =>      'mods/_standard',
+                    '/polls'           =>      'mods/_standard',
+                    '/sitemap'         =>      'mods/_standard',
+                    '/social'          =>      'mods/_standard',
+                    '/social/groups'=> 'mods/_standard',
+                    '/student_tools'=> 'mods/_standard',
+                    '/tile_search'  => 'mods/_standard',
+                    '/tests'           =>      'mods/_standard',
+                    '/tracker'         =>      'mods/_standard',
+                    '/reading_list'    =>      'mods/_standard'
                                );
 
                if ($this->path != ''){