Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
DorsetDigital Remove redundant config variable
Update middleware reference
Latest commit ac0fb8c Sep 17, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
_config Remove redundant config variable Sep 17, 2019
src Remove redundant config variable Sep 17, 2019 Update readme May 22, 2018 Update Readme Sep 17, 2019
composer.json First version of rewriter Sep 17, 2019

Silverstripe URL Rewriter

Provides a simple method of rewriting the URLs of assets. This was developed primarily for use with the SilverStripe S3 assets module, allowing a quick method of using a CloudFront distribution to serve assets instead of linking directly to the S3 bucket.


*Silverstripe 4.x


  • Install the code with composer require dorsetdigital/silverstripe-url-rewriter
  • Run a dev/build?flush to update your project


The module won't make any changes to your site unless you do a bit of configuration. There are a few options you can set, done in a yml file:

Name: rewriteconfig

  rewrite_enabled: true
  old_url: ''
  new_url: ''  
  enable_in_dev: true

The options are hopefully fairly self explanatory:


  • The module is disabled in the CMS / admin system, so rewrites do not currently happen here
  • When enabled, the module will always add an HTTP header of X-Rewrites: Enabled to show that it's working, even if none of the other rewrite operations are carried out. If this is not present and you think it should be, ensure that you have set cdn_rewrite to true, that you have specified the cdn_domain in your config file and that you have enable_in_dev set to true if you are testing in dev mode.
You can’t perform that action at this time.