Apache Sling URL Rewriter

Clone this repo:
  1. 4985b7d Updating badges for org-apache-sling-urlrewriter by Radu Cotescu · 12 months ago master
  2. dd9a43b SLING-7245 - Validate pull requests using Jenkins by Robert Munteanu · 12 months ago
  3. bcd51c7 trivial: added license header to *.md files by Radu Cotescu · 1 year, 4 months ago
  4. 86d7061 SLING-7215 - [nice-to-have] Add a CONTRIBUTING file to every module by Radu Cotescu · 1 year, 4 months ago
  5. f1b1f49 SLING-7216 - [nice-to-have] Add a CODE_OF_CONDUCT file to every module by Radu Cotescu · 1 year, 4 months ago

Build Status Maven Central JavaDocs License

Apache Sling URL Rewriter

This module is part of the Apache Sling project.

multi-purpose service for altering HTTP requests/responses based on Tuckey's UrlRewriteFilter

example for setting a Cache-Control header:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN" "http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
    <set type="response-header" name="Cache-Control">max-age=600</set>

example for setting CORS headers:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN" "http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
    <condition type="header" name="Origin">.*</condition>
    <condition type="header" name="Access-Control-Request-Method">.*</condition>
    <condition type="header" name="Access-Control-Request-Headers">.*</condition>
    <set type="response-header" name="Access-Control-Allow-Origin">%{header:Origin}</set>
    <set type="response-header" name="Access-Control-Allow-Methods">%{header:Access-Control-Request-Method}</set>
    <set type="response-header" name="Access-Control-Allow-Headers">%{header:Access-Control-Request-Headers}</set>
    <set type="response-header" name="Access-Control-Allow-Credentials">true</set>