Documentation

Rewrite – Map URLs

Posted in: Getting Started (4) Plugin Options Explained (35) Actions / Filters (30) How To (14)   

This functionality is available for PRO version.

The Map URLs module can e used to change individual URL to custom ones. The interface consists of 2 fields, a Url to replace and a Url replacement.

Any site URL’s can be mapped to something else. Any type of asset works with re-mapping e.g JavaScript, Cascading Style Sheets, Media Images etc. An url should always start with a slash.


/wp-content/plugins/qxshop/assets/js/frontend/qxshop.min.js

to


/ecommerce.min.js

Directories can also be re-mapped, they need to end in a forwardslash


/wp-content/cache/

to


/static-data/

The plugin cache directory can be easily changed to something else using something like this


/wp-content/cache/wph/

to


/app-data/

On WordPress MultiSite environment, if using multiple domains and specific URLs need to be changed per domain base; the –domain-name– should be replaced with actual one:


//--domain-name--/wp-content/plugins/woocommerce/assets/js/frontend/cart.js

to


//--domain-name--/shopp.js

There are few requirements for a replacement and replace Url for the module to process:

  • The resource must be on the same domain as the website or if run on MultiSite, the resources must match one of the existing domains.
  • The URL’s can start or not with a domain. If starts with a domain, a double slash should be prepended per above example.
  • If the asset has been already rewritten by another module, but still required to be modified further, the last format will be used, which can be seen on outputted HTML.
  • If there are multiple instances of the same URL (e.g. image asset) all will be replaced with the new provided Url.
  • Any incomplete or invalid URL, either the replaced or replacement makes the entry obsolete and will be ignored.
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Scroll to top