Skip to content

Instantly share code, notes, and snippets.

@mrded
Created October 17, 2014 11:19
Show Gist options
  • Save mrded/90312cc02179e06b6e63 to your computer and use it in GitHub Desktop.
Save mrded/90312cc02179e06b6e63 to your computer and use it in GitHub Desktop.
Drupal: Make any request starting with /js/ is forwarded to js.php
<?php
if (preg_match("/^(\/js\/)/", $_SERVER['REQUEST_URI'])) {
header('HTTP/1.0 301 Moved Permanently');
header('Location: /js.php?q=' . preg_replace("/^(\/js\/)/", '', $_SERVER['REQUEST_URI']));
exit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment