Alias ‘wp-content’ directory to something shorter (framework?)

I recall seeing this as a feature of a WordPress Development Framework, so I know it’s possible (can’t remember the framework). I am interested in how to condense the WordPress-generated urls to something more concise and not so “WordPressy”.

I’m thinking that I would have to both update the .htaccess and add some kind of filter to alter the path prior to being output to the page.

Here is something along the lines of what I’m looking for:

Current: http://www.domain.com/wp-content/themes/test/assets/css/site.css
Shorter: http://www.domain.com/theme/assets/css/site.css

Current: http://www.domain.com/wp-content/plugins/foo-bar/plugin.css
Shorter: http://www.domain.com/plugins/foo-bar/plugin.css

Current: http://www.domain.com/wp-content/uploads/2018/09/foo.jpg
Shorter: http://www.domain.com/uploads/2018/09/foo.jpg

If you check out https://aigany.org/, it looks like they are doing something similar.

Thanks for the help.

0

Leave a Comment