GithubHelp home page GithubHelp logo

isabella232 / roots-rewrites Goto Github PK

View Code? Open in Web Editor NEW

This project forked from roots/roots-rewrites

0.0 0.0 0.0 185 KB

Unsupported: Clean URL rewrites for WordPress assets

License: MIT License

PHP 100.00%

roots-rewrites's Introduction

Roots Rewrites

Roots Rewrites enables clean URL rewrites for your WordPress plugins and theme assets folder.

/wp-content/themes/themename/assets/css/ to /assets/css/
/wp-content/themes/themename/assets/js/  to /assets/js/
/wp-content/themes/themename/assets/img/ to /assets/img/
/wp-content/plugins/                     to /plugins/

Note: If you use Composer to manage WordPress then you don't need to use this plugin, as your paths would look like:

/app/themes/themename/assets/css/
/app/themes/themename/assets/js/
/app/themes/themename/assets/img/
/app/plugins/

Requirements

  • Apache with mod_rewrite enabled through .htaccess; Nginx (see Installation for configuration); or any other server that allows you to control its rewrite rules.

  • Roots Theme (6.5.1+) is recommended for compatibility, but is not a requirement since 1.0.1

Installation

Apache will flush rewrite rules on activation and deactivation.

If you're using Nginx, you'll need to add the Roots rewrites to your server config before the PHP block (location ~ \.php$):

location ~ ^/assets/(img|js|css|fonts)/(.*)$ {
  try_files $uri $uri/ /wp-content/themes/roots/assets/$1/$2;
}
location ~ ^/plugins/(.*)$ {
  try_files $uri $uri/ /wp-content/plugins/$1;
}

Support

This plugin is no longer supported by Roots and is unlikely to be updated.

Troubleshooting

Visit your site's permalinks page to flush rewrite rules; and open .htaccess to check that the rules are being written correctly.

Community Support

You may visit Roots Discourse and search for answers or ask questions.

Changelog

1.0.1: August 14th, 2014

  • Supports non-Roots based themes, de/activation hooks added to flush rewrites

1.0.0: November 5th, 2013

License

MIT License

roots-rewrites's People

Contributors

foxaii avatar jvanderheide avatar qwp6t avatar retlehs avatar swalkinshaw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.