google-code-backups / get-simple-cms

Automatically exported from code.google.com/p/get-simple-cms
GNU General Public License v3.0
0 stars 0 forks source link

Root .htaccess not created (on some servers) #286

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Root .htaccess is not being created (i.e. temp.htaccess is not renamed) when 
installing GS. Happens on some (or many?) servers, webhosts that don't have 
apache_get_modules()
http://get-simple.info/forum/topic/3186/root-htaccess-not-created-when-installin
g-on-some-servers/

Original issue reported on code.google.com by carnav on 21 Jan 2012 at 8:29

GoogleCodeExporter commented 8 years ago
I have just tested the patch I suggested in that thread, and works as expected 
when installing in these 3 different server setups:
- mod rewrite supported, but apache_get_modules() not available -> .htaccess is 
created
- apache_get_modules() available, mod_rewrite available -> .htaccess is created
- apache_get_modules() available, mod_rewrite NOT available -> .htaccess is NOT 
created (remains as temp.htaccess)

Reminder - the patch is: admin/setup.php (around line 114), change:

        # create root .htaccess file
        if ( function_exists('apache_get_modules') ) {
            if(in_arrayi('mod_rewrite',apache_get_modules())) {
                ...
            }
        }

to:

        # create root .htaccess file
        if ( !function_exists('apache_get_modules') or in_arrayi('mod_rewrite',apache_get_modules()) ) {
            ...
        }

(Note that there were two if's and now it'd be only one, so you have to remove 
one of the closing "}")

Original comment by carnav on 21 Jan 2012 at 11:28

GoogleCodeExporter commented 8 years ago
I've updated this fix in the SVN, tested and seems to be working fine, 

Thanks...

Original comment by MichaelS...@gmail.com on 24 Jan 2012 at 9:55