Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add apache rewrite rule to ansible for migrated media #264

Closed
rlskoeser opened this issue Dec 18, 2020 · 1 comment
Closed

add apache rewrite rule to ansible for migrated media #264

rlskoeser opened this issue Dec 18, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@rlskoeser
Copy link
Contributor

I think the apache rewrite rule we want should be something like this:

RewriteEngine On
RewriteCond "%{REQUEST_URI}"  "^/media/uploads" 
RewriteRule "/(.*\.(jpg|jpeg|gif|png))$" "/media/original_images/$1" [L,R=301]

It's not working in an online regex tester but I'm not sure why, and this is pretty close to some of the examples in the apache documentation, so hopefully it will work with a little testing and tweaking.

@thatbudakguy how/where should we track adding this to our deploy apache conf? We can't add it yet or because will break cdhweb 2.8.1.

Originally posted by @rlskoeser in #248 (comment)

@rlskoeser rlskoeser added this to the v3.0 milestone Dec 18, 2020
@rlskoeser rlskoeser self-assigned this Jan 11, 2021
@thatbudakguy thatbudakguy modified the milestones: v3.0, v3.0.1 Feb 24, 2021
@rlskoeser rlskoeser modified the milestones: v3.0.1, v3.0 Mar 12, 2021
@thatbudakguy
Copy link
Contributor

confirmed working by testing two different images at their old URLs, which successfully redirected with a 301 (embedded in blogpost and featured on project page).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants