Search doesn't work with mod_rewrite enabled

Hi

I have enabled the "mod rewrite" option under "Options > General > URL Options" and for he most part everything works as expected. Unfortunately enabling this option breaks my search.

I have assigned the tag "Test Tag" to a single album and 6 images.

When I search for "Test Tag" with "mod rewrite" enabled nothing will show. However, if I disable this option and search for "Test Tag" the album and 6 images show as intended.

I checked the debug log but there are no entries logged for today.

My site can be found here: southsmuseumofpostcards.nz

Any help with this would be greatly appreciated.

Comments

  • fretzl Administrator, Developer
    Try to "Purge search cache" on the Admin > Overview page.
    Also on Admin > Options > Search, set Cache expiry to 0 (zero) for the time being.
  • I have set the "cache expiry" option to 0 and enabled the "cacheManager" plugin, I then used the "purge search cache" option.

    Unfortunately the search still returns no results.

    I noticed the search works (even with mod_rewrite enabled) if I type the keywords into the URL manually, for example:

    After submitting a search the URL is:
    https://southsmuseumofpostcards.nz/page/search

    The above returns no results. If I change the URL to this:
    https://southsmuseumofpostcards.nz/page/search/"test tag"

    The album and images are displayed.

    I'm not sure if this will be helpful in finding out why my search isn't working but I thought I'd mention it just in case.
  • acrylian Administrator, Developer
    I think something might not be right on your site. I assume you have the correct 'htaccess' file and your server really supports modrewrite.

    On using the search I shortly see the url `https://southsmuseumofpostcards.nz/index.php?p=search` before it switches to the actualy `https://southsmuseumofpostcards.nz/page/search`.
    That's the correct url without modrewrite but if you have modrewrite this should never happen.

    A few general things to try:
    - Disable https
    - Check the search field options
    - Try a official theme
    - check error logs
  • Thank-you very much for your help, I found the problem and now the search works.

    There was a problem with my search form's action which was still pointing to "index.php?p=search" even if "mod_rewrite" was enabled. I added a check to change the action depending on whether or not "mod_rewrite" is enabled and it now works as expected.

    Thanks again for your help :)
Sign In or Register to comment.