0

I'm having trouble with the file path when I upload my development environment to the server.

The problem is actually quite simple.
Development is working on the root folder ( development.tld )
Production is working on the sub-folder ( production.tld/sub-folder )

When I manually add a image in node content on the development environment, the path to that file is /sites/default/files/test.jpg

That path will not work in the production environment because of the sub-folder.

Sample node content:

<div class="row">
    <div class="span6">
        <img alt="test 1" src="/sites/default/files/test1.jpg">
    </div>

    <div class="span6">
        <img alt="test 2" src="/sites/default/files/test2.jpg">
    </div>
</div>

RewriteBase /sub-folder method works properly in general but I need to remap requests for the manually added assets
( /sites/default/files/* to /sub-folder/sites/default/files/* )

Is there a Rewrite rules for this process?

Thank you.

0

Try changing (or assigning) the base url in sites/default/settings.php

| improve this answer | |
0

Try changing the path of public file system path,

Navigate to example.com/admin/config/media/file-system

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.