Masking or rewriting urls on HTML Head section

Jorge Batres
Jorge Batres used Ask the Experts™
on
Hi, I was wondering if someone could please help me figure out a way to change the template's theme name as shown below, on the urls in the head section of my site without actually renaming the folders/directories on the template itself.

If I were to rename the folders on the actual template structure, everything would break, and even if it didn't, the automatic theme updates would not work, and for that reason, I need to figure out a way to mask, or rewrite the urls without breaking the theme template.

I have been searching online for a way to do this on my server, but no luck so far. Please help.

<link href="/templates/template-name/css/theme.9.css?v=1537979830" rel="stylesheet" id="theme-style-css" />
      <link href="/templates/template-name/css/theme.update.css?v=1.15.7" rel="stylesheet" id="theme-style-update-css" />
      <script src="/media/jui/js/jquery.min.js"></script>
      <script src="/media/jui/js/jquery-noconflict.js"></script>
      <script src="media/system/js/copyright.js"></script>
      <script src="/templates/template-name/vendor/assets/uikit/dist/js/uikit.min.js?v=1.15.7"></script>
      <script src="/templates/template-name/vendor/assets/uikit/dist/js/uikit-icons-fjord.min.js?v=1.15.7"></script>
      <script src="/templates/template-name/js/theme.js?v=1.15.7"></script>

My server configuration is as follows:

Red Hat Enterprise Linux Server 7.5

Plesk Onyx Version 17.8.11

PHP 7.2.11

Apache and FPM Application served by Nginx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
David FavorFractional CTO
Distinguished Expert 2018

Commented:
You question is worded oddly, so likely if you're more specific, someone can help.

Expand about your template. Sounds like you're trying to replace a PLESK template.

Author

Commented:
Sorry for the confusion, this is a Joomla template and what I'm trying to accomplish is to mask the name of the template on the urls calling files like CSS and JS on the head section of the source code.

So, if possible I'd like to modify the url like this

<script src="/templates/template-current-name/vendor/assets/uikit/dist/js/uikit.min.js?v=1.15.7"></script>

to

<script src="/templates/anything-else/vendor/assets/uikit/dist/js/uikit.min.js?v=1.15.7"></script>
Top Expert 2004

Commented:
What is the purpose behind your proposed change?

Joomla's core code builds those paths as part of the CMS.  Specifically, the theme name is important for anything auto-discovered inside the template.  For example, this affects the path used to reference theme CSS files, JS files, HTML overrides, and theme asset files.  Normally, if you want to change the path, you would create a template with the new name you want to use.

It sounds like your trying to obfuscate the source of these files.  But you have to realize that no matter where the file comes from, the user will have the information in the file.  The directory structure for Joomla is already well-documented, and its footprint is very recognizable.  Even with obfuscation of the CSS/JS, the files themselves would be easy to find.  What benefits are you trying to achieve?
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Steve said it best, "What are you trying to achieve by your changes?"

Author

Commented:
In a few words, white label the theme.

In the past, for the themes I use, the only thing needed was to rename the folder and one xml file before installation.

I don't want to remove any copyrights on the source code of the theme itself, but it would be nice to personalize the theme name, and that option is not available as of now.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
You do realize this problem violates the theme's copyright terms.

For example, if you do this with a WordPress.org theme the Automattic company (which is WordPress.com) will find you + sue you.

I'm unsure how Joomla handles this + likely you're breaking copyright terms doing this.

Best you post in the Joomla support forums + ask how best to do this.

Author

Commented:
Ok, thanks.
Top Expert 2004
Commented:
You should definitely check with the seller's/author's terms to see if this is allowed.  If you decide to move forward, uninstall/rename/install may work for you.  If you're dealing with an install package that does not allow that sort of customization, you would need to change the data in the database after installation.  This would involve manual manipulation of the extensions table, and likely template_styles.

Even then, Joomla's auto-loading leans heavily on name-based folder structures.   You could end up just hosing up your installation.  The 100% sure-fire method to do this would be to generate a new theme based on the original.  You could still run into infringement issues there, though.

Author

Commented:
Thank you Steve, I think the theme developer mentioned that they will eventually move css and js files to improve  above the fold optimization.

I appreciate your input though.

Thanks again.
Jorge B.
Top Expert 2016

Commented:
valid information given by experts

Author

Commented:
Thanks
Scott FellDeveloper & EE Moderator
Fellow 2018
Most Valuable Expert 2013

Commented:
It looks like the documentation you want is here https://docs.joomla.org/J3.x:How_to_use_the_Template_Manager and lists the instructions for changing the name of the template folder.  

As for changing the file/folder names and license for use, I have purchased many themes and don't remember seeing anything like that. I just looked at my last few purchases and didn't see anything to that situation.  The standard license for themeforest as example https://themeforest.net/licenses/standard.  

I have seen where themes can be white labeled as part of a package or for an additional charge as a plug in. But there is no license issue to do it on your own, but in those cases, it would be pretty hard to do it on your own as the larger themes with builders may need a lot of adjustments.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial