Skip to content

URL Rewrites

Nick Shoults edited this page Oct 13, 2023 · 3 revisions

Server Side

URL Rewrites depends on both a server-side configuration and a configuration change for Designer Widgets. Each type of server configures URL Rewrites differently. Below we provide the solution we use in Word Press, for other types of hosting you will need to work with your hosting provider to properly configure URL Rewrites for your site.

Word Press

We have successfully used the Redirection plugin for Word Press and recommend it for consideration. We use a regular expression (regex) to match urls with “/shop/” and pass that along to a word press page named shop without changing the URL. The image below shows these settings.
Word Press Redirection Plugin

Designer Widget Settings

Our epubOptions then get initLocationPath: true like so:

epubOptions = {
  APIKey: '<provided by eCellar>',
  pathRoot: '/shop/',
  initLocationPath: true
}

Now our current releases URL changes from

https://<www.yoursite.com>/shop/?view=products&slug=current-releases

to

https://<www.yoursite.com>/shop/products/current-releases

Note: if you decide to use rewrites, you MUST:

1. Let eCELLAR Support know the rewrite URLs for your Site Settings.

2. Realize that, if you switch an existing site to rewrites, links that used to include query strings will no longer work.