/Search-results? goes to root

Posted by Community Admin on 03-Aug-2018 00:23

/Search-results? goes to root

All Replies

Posted by Community Admin on 24-Nov-2011 00:00

Our site lives on a folder on a domain, ala http://domain.com/foldername
Go to http://domain.com/foldername and you get the home page of our site

When using the Sitefinity search, it always resolves to http://domain.com/search-results?indexCatalogue=index&bla
But I need it to keep that Folder name in the URL.

Oddly enough, on some pages the site still resolves and displays the results as expected with out that folder name (caching I would imagine or some kind of session being held) but on some pages, it breaks

I want http://domain.com/foldername/search-results?indexCatalogue=index&bla
not
http://domain.com/search-results?indexCatalogue=index&bla

Ideas?

Posted by Community Admin on 24-Nov-2011 00:00

Ryan,

You can try something like this in your web.config.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Search Results Rewrite" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="search-results" />
                    <action type="Redirect" url="/sitefolder/search-results" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

You'll need to modify that snippet for your needs but it should get you started. There's also an option located in Administration -> Settings -> Advanced -> System -> Site URL Settings that may be of some use.

This thread is closed