Move image fallback logic out of htaccess

RESOLVED FIXED in 6.4.5

Status

RESOLVED FIXED
7 years ago
3 years ago

People

(Reporter: clouserw, Assigned: clouserw)

Tracking

unspecified
6.4.5

Details

(Assignee)

Description

7 years ago
Right now if an image doesn't exist on disk we show a fallback image.  There's no reason for this to live in apache.  If a $object doesn't have an image, send the fallback image URL.  If someone manually goes to a bad image, they'll get a 404, as expected.  Please avoid bug 731089 and bug 731097 when you're doing this or they'll be conflicts.  Rewrites:

>    ## fall userpics on anon
>    RewriteCond %{REQUEST_FILENAME} !-f
>    RewriteRule ^img/uploads/userpics/.* /img/anon_user.png [L]
>
>    ## fall addon icons on default
>    RewriteCond %{REQUEST_FILENAME} !-f
>    RewriteRule ^img/uploads/addon_icons/.* /img/default_icon.png [L]
>
>    ## fall collection icons on collection.png
>    RewriteCond %{REQUEST_FILENAME} !-f
>    RewriteRule ^img/uploads/collection_icons/.* /img/collection.png [L]
(Assignee)

Comment 1

7 years ago
(In reply to Wil Clouser [:clouserw] from comment #0)
> Right now if an image doesn't exist on disk we show a fallback image. 
> There's no reason for this to live in apache.  If a $object doesn't have an
> image, send the fallback image URL.  If someone manually goes to a bad
> image, they'll get a 404, as expected.  Please avoid bug 731089 and bug
> 731097 when you're doing this or they'll be conflicts.  Rewrites:
> 
> >    ## fall userpics on anon
> >    RewriteCond %{REQUEST_FILENAME} !-f
> >    RewriteRule ^img/uploads/userpics/.* /img/anon_user.png [L]

apps/users/models.py line 189

> >    ## fall addon icons on default
> >    RewriteCond %{REQUEST_FILENAME} !-f
> >    RewriteRule ^img/uploads/addon_icons/.* /img/default_icon.png [L]

This is settings.ADDON_ICONS_DEFAULT_URL.  We're good there.

> >    ## fall collection icons on collection.png
> >    RewriteCond %{REQUEST_FILENAME} !-f
> >    RewriteRule ^img/uploads/collection_icons/.* /img/collection.png [L]

apps/bandwagon/models.py line 264



We're good here.
Assignee: nobody → clouserw
Target Milestone: --- → 6.4.5
(Assignee)

Updated

7 years ago
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.