Notify the user if mod_rewrite is disabled and provide a guide to get chive up and running or provide a fallback-mode whitout mod_rewrite

Registered by David Roth

Mod_Rewrite is is not enabled by default on a lot of servers. At the moment there is no useful information and the user does not know what to do because he only sees an http error page.

Two possibilities:

1) Show an error-page with information about how to enable mod_rewrite in order to get chive up and running.

or

2) Implement a fallback-mode without mod_rewrite.

I would recommend the second approach.

Blueprint information

Status:
Complete
Approver:
David Roth
Priority:
High
Drafter:
Matthias Burtscher
Direction:
Approved
Assignee:
Matthias Burtscher
Definition:
Approved
Series goal:
Accepted for 0.1
Implementation:
Implemented
Milestone target:
milestone icon 0.3.0
Started by
Matthias Burtscher
Completed by
David Roth

Related branches

Sprints

Whiteboard

Pushed revision 290 to trunk which makes chive work without mod_rewrite.

All Links are formatted as /path/to/chive/index.php/schemata/x/tables etc. if mod_rewrite is disabled.

Chive automatically detects wether mod_rewrite is installed on the server or not. .htaccess file contains the following rewrite rules:

<IfModule mod_rewrite.c>
 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?__chive_rewrite_on=1
 RewriteRule ^$ index.php?__chive_rewrite_on=1
</IfModule>

In the configuration file (protected/config/main.php) we check if __chive_rewrite_on parameter is set or not and set the "showScriptName" argument of "urlManager" to true/false:

'showScriptName' => !isset($_GET['__chive_rewrite_on']),

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.