mod_rewrite is enabled but zp says it is not

I've just installed zp 1.4.12 on apache 2.4 (Solaris 11). Everything except mod_rewrite appears to be fine. Apache has mod_rewrite loaded (apachectl -M, and phpinfo() and apache_get_modules() confirm this). But zp indicates that mod_rewrite is not loaded.

Permissions on /<zp_base_dir>/.htaccess are 444. I have not made any changes to the <zp_base_dir>/.htaccess file.
And in the httpd.conf I changed AllowOverride to All (from None). (I thought this last action might have solved it).

Given the above, zp still declares that 'Setup did not detect a working mod_rewrite facility' in Admin|Options|General|URL options.

Can someone point me to a solution?
Thanks

Comments

  • I've followed the logic in zp php files and then confirmed that an attempt to access /<zp_base_dir>/page/setup_set-mod_rewrite/?z=setup results in a 404 error. So that explains why zp thinks mod_rewrite is not installed.

    So this seems to indicate there is a problem in the rewrite rules. Comments in the .htaccess indicate that that file is no longer used for rewrite rules. Instead, apparently /<zp_base_dir/zp-core/zenphoto-rewrite.txt is used and rewriting is handled in PHP. Neither of these files have been modified.

    Help?
  • [06/May/2016:10:16:49 -0500] "GET /photo/page/setup_set-mod_rewrite?z=setup HTTP/1.1" 301 270
    [06/May/2016:10:16:49 -0500] "GET /photo/page/setup_set-mod_rewrite/?z=setup HTTP/1.1" 404 6627

    I'm still trying to make sense of the installed rewriting rules. But it seems that the .htaccess file _is_ used. But the 'interesting' rules are handled by the second file (zenphoto-rewrite.txt).

    The above apache access log info seems to indicate that the above file _is_ being used (because it successfully does a 301 URL redirect), but it then fails to find the URL to which it is redirected.

    I'm afraid this is the end of the trail for me.

    Can someone help?
  • acrylian Administrator, Developer
    Yes, the root htaccess is used but since you can change url keywords for some url types (Zenpage CMS plugin urls, archive etc) it does not handle everything.

    Sadly no idea as I never encountered this on various shared hosts. This was recently discussed here already without any solution:
    http://www.zenphoto.org/support/topic.php?id=1409420#post-1977676
  • Thanks. Can someone take a look at your apache access_log file and note the references to setup_set-mod_rewrite ? I just want to confirm that the 2nd one here (the one that the first one redirects to) is valid.

    [06/May/2016:10:16:49 -0500] "GET /photo/page/setup_set-mod_rewrite?z=setup HTTP/1.1" 301 270
    [06/May/2016:10:16:49 -0500] "GET /photo/page/setup_set-mod_rewrite/?z=setup HTTP/1.1" 404 6627

    IOW, is the rewritten URL simply one in which the '/' is inserted before the '?' ? And is access to that 2nd URL noted to be valid in the access_log on your setup?

    Thanks
  • Nevermind. I reran zp-core/setup.php and mod_rewrite was just fine. Go figure.
  • acrylian Administrator, Developer
    The actual test part of the url for modrewrite is `/photo/page/`. But glad it is working (again) for you now!
Sign In or Register to comment.