Skip to content

Commit

Permalink
Use .htaccess to route all queries through index.php so index.php/adm…
Browse files Browse the repository at this point in the history
…in becomes /admin - GCI Task #7237230 by gautamgupta

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@11677 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
GautamGupta committed Dec 18, 2011
1 parent 56b91d8 commit ec09b53
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .htaccess
@@ -0,0 +1,8 @@
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php
2 changes: 1 addition & 1 deletion application/config/application.php
Expand Up @@ -28,7 +28,7 @@
| variable so that it is blank.
|
*/
$config['index_page'] = 'index.php';
$config['index_page'] = '';

/*
|--------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions application/config/config.php
Expand Up @@ -52,6 +52,7 @@
'urlManager' => array(
'urlFormat' => 'path',
'rules' => require('routes.php'),
'showScriptName' => false,
),

),
Expand Down
2 changes: 1 addition & 1 deletion application/config/routes.php
Expand Up @@ -45,7 +45,7 @@
$route['(:num)'] = "survey/sid/$1";

//Admin Routes
$route['admin'] = "admin/index";
$route['admin/index'] = "admin";
$route['admin/labels/view'] = "admin/labels/view";

//question
Expand Down
1 change: 1 addition & 0 deletions application/controllers/InstallerController.php
Expand Up @@ -943,6 +943,7 @@ function _writeConfigFile()
."\t\t" . "'urlManager' => array(" . "\n"
."\t\t\t" . "'urlFormat' => 'path'," . "\n"
."\t\t\t" . "'rules' => require('routes.php')," . "\n"
."\t\t\t" . "'showScriptName' => false," . "\n"
."\t\t" . ")," . "\n"
."\t" . "" . "\n"

Expand Down

0 comments on commit ec09b53

Please sign in to comment.