Skip to content

Instantly share code, notes, and snippets.

@pmgarman
Forked from nickdavis/gist:10525079
Last active September 5, 2024 01:49
Show Gist options
  • Select an option

  • Save pmgarman/8fba357c97193633a66d to your computer and use it in GitHub Desktop.

Select an option

Save pmgarman/8fba357c97193633a66d to your computer and use it in GitHub Desktop.

Revisions

  1. Patrick Garman revised this gist Dec 19, 2014. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,7 @@
    #301 Redirect Local Images to Live
    RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1
    # Apache .htaccess
    RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1

    # Nginx
    location ~ ^/wp-content/uploads/(.*) {
    rewrite ^/wp-content/uploads/(.*)$ http://livewebsite.com/wp-content/uploads/$1 redirect;
    }
  2. @nickdavis nickdavis created this gist Apr 12, 2014.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    #301 Redirect Local Images to Live
    RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1