We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 365
    • 9 Posts
    I’m having an issue where URLs to images stored in assets are being rewritten if the webpage containing the asset is stored in a folder within the root resource article. If the resource article is stored directly in root, the problem doesn’t happen.

    Example:
    
    Actual Images path - http://website.com/assets/picture.jpg
    Webpage path - http://website.com/webpage_folder/page.php
    Incorrect Rewritten Image path - http://website.com/webpage_folder/assets/picture.jpg
    


    I need the generated URL to go to the actual image path above not the Incorrect Rewritten Image path.

    Here is my .htaccess file

    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    
    # Fix Apache internal dummy connections from breaking [(site_url)] cache
    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    RewriteRule .* - [F,L]
    
    # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
    #RewriteCond %{HTTP_HOST} .
    #RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
    #RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    
    # Exclude /assets and /manager directories and images from rewrite rules
    RewriteRule ^(manager|assets)/*$ - [L]
    RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
    
    # For Friendly URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]



    Thanks