Home > Fluid Dynamics Search Engine > Help > 1148

Using relative paths in the search results

FDSE will use absolute URL's whenever possible, i.e. "http://www.xav.com/scripts/". In some cases it is desirable to use relative URL's, like "/scripts/", in the search results for visitors to click on.

To force FDSE to use relative URL's in search result links, follow these steps:

  1. Make sure you are running FDSE version or newer.

  2. Go to "Admin Page" => "Filter Rules" => (scroll down) => "URL Rewrite Rules".

  3. The "URL Rewrite Rules" allow you to change the way URL's appear.

    FDSE must use full absolute URL's internally, and so we just want to rewrite them at the very last minute, before they are presented to the visitor. For this we need to use the second type of rule, the Output Filter.

    Create an output filter with the following parameters:

    Enabled Verbose Pattern Replace

    This filter will make URL's that start with "http://www.xav.com/" start with "/".

    If all of the URL's in all of your search indexes are on the same server as the search engine, then you can use this more general pattern:

    Enabled Verbose Pattern Replace

  4. Submit the "Save Data" button to save changes.

    Output Filters take effect immediately; it is not necessary to rebuild your search index.

Reasons to use relative paths

Reasons for using relative links include 1) visitor's browser can use HTTP keep-alive socket to request results faster and 2) if your site is hosted using a variety of hostnames, this will keep the visitor on the same host as he initially used and 3) if your search engine is being accessed over SSL, and you want the results to be accessed the same way, this will preserve the SSL context.

    "Using relative paths in the search results"