1

I was having a lot of problems with the UrlRewriter not working so I simplified it so it actually does nothing to see if I could get that to work, but it still fails to correctly load the pages. I keep getting 503 errors seemingly no matter what I do.

Note: This is for a knowledge site

I have the following code which seems to work, but I don't understand what customerPortalUrl is coming in as:

global class CustomUrlRewriter implements Site.Urlrewriter {
    global PageReference mapRequestUrl(PageReference customerPortalUrl) {
        return null;
    }

    global List<PageReference> generateUrlFor(List<PageReference> salesforceUrls) {
        return null;
    }
}

1 Answer 1

1

You will need to write code in the mapRequestUrl method to match the url pattern of the request and let it pass through unchanged.

String url = customerPortalUrl.getUrl();
if (url.contains('{the_url_pattern}') {
    return customerPortalUrl;
}

For your simplified example, try to just return customerPortalUrl instead of null.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .