{"id":1570,"date":"2023-06-26T13:24:14","date_gmt":"2023-06-26T13:24:14","guid":{"rendered":"https:\/\/www.darrenlambert.com\/?p=1570"},"modified":"2023-06-26T13:24:14","modified_gmt":"2023-06-26T13:24:14","slug":"wp-engine-redirect-rules","status":"publish","type":"post","link":"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/","title":{"rendered":"WP Engine Redirect Rules"},"content":{"rendered":"

Since WP Engine deprecated .htaccess support<\/a> we need to use different methods to redirect old URLs.<\/p>\n

They offer a good redirect rule system.<\/p>\n

Here’s an solution to redirect the following structure<\/p>\n

www.domain.com\/wp-content\/documents\/document-name.pdf<\/em><\/p>\n

to this new structure<\/p>\n

www.domain.com\/document\/document-name<\/em><\/p>\n

Source<\/p>\n

^\/wp-content\/documents\/(.*?)\\.pdf$<\/pre>\n

Destination<\/p>\n

https:\/\/www.domain.com\/document\/$1<\/pre>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

Since WP Engine deprecated .htaccess support we need to use different methods to redirect old URLs. They offer a good redirect rule system. Here’s an solution to redirect the following structure www.domain.com\/wp-content\/documents\/document-name.pdf to this new structure www.domain.com\/document\/document-name Source ^\/wp-content\/documents\/(.*?)\\.pdf$ Destination https:\/\/www.domain.com\/document\/$1  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"yoast_head":"\nWP Engine Redirect Rules - Darren Lambert<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WP Engine Redirect Rules - Darren Lambert\" \/>\n<meta property=\"og:description\" content=\"Since WP Engine deprecated .htaccess support we need to use different methods to redirect old URLs. They offer a good redirect rule system. Here’s an solution to redirect the following structure www.domain.com\/wp-content\/documents\/document-name.pdf to this new structure www.domain.com\/document\/document-name Source ^\/wp-content\/documents\/(.*?).pdf$ Destination https:\/\/www.domain.com\/document\/$1  \" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/\" \/>\n<meta property=\"og:site_name\" content=\"Darren Lambert\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-26T13:24:14+00:00\" \/>\n<meta name=\"author\" content=\"Darren\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Darren\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/\",\"url\":\"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/\",\"name\":\"WP Engine Redirect Rules - Darren Lambert\",\"isPartOf\":{\"@id\":\"https:\/\/www.darrenlambert.com\/#website\"},\"datePublished\":\"2023-06-26T13:24:14+00:00\",\"dateModified\":\"2023-06-26T13:24:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.darrenlambert.com\/#\/schema\/person\/ba3d82eb3f9925e946dae3b57e35bb79\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.darrenlambert.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WP Engine Redirect Rules\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.darrenlambert.com\/#website\",\"url\":\"https:\/\/www.darrenlambert.com\/\",\"name\":\"Darren Lambert\",\"description\":\"WordPress & WooCommerce Expert\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.darrenlambert.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.darrenlambert.com\/#\/schema\/person\/ba3d82eb3f9925e946dae3b57e35bb79\",\"name\":\"Darren\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.darrenlambert.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/076d975a0d00c5b2d53e2f76076cf5cf?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/076d975a0d00c5b2d53e2f76076cf5cf?s=96&d=mm&r=g\",\"caption\":\"Darren\"},\"url\":\"https:\/\/www.darrenlambert.com\/author\/darren\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WP Engine Redirect Rules - Darren Lambert","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/","og_locale":"en_US","og_type":"article","og_title":"WP Engine Redirect Rules - Darren Lambert","og_description":"Since WP Engine deprecated .htaccess support we need to use different methods to redirect old URLs. They offer a good redirect rule system. Here’s an solution to redirect the following structure www.domain.com\/wp-content\/documents\/document-name.pdf to this new structure www.domain.com\/document\/document-name Source ^\/wp-content\/documents\/(.*?).pdf$ Destination https:\/\/www.domain.com\/document\/$1  ","og_url":"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/","og_site_name":"Darren Lambert","article_published_time":"2023-06-26T13:24:14+00:00","author":"Darren","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Darren","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/","url":"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/","name":"WP Engine Redirect Rules - Darren Lambert","isPartOf":{"@id":"https:\/\/www.darrenlambert.com\/#website"},"datePublished":"2023-06-26T13:24:14+00:00","dateModified":"2023-06-26T13:24:14+00:00","author":{"@id":"https:\/\/www.darrenlambert.com\/#\/schema\/person\/ba3d82eb3f9925e946dae3b57e35bb79"},"breadcrumb":{"@id":"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.darrenlambert.com\/wp-engine-redirect-rules\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.darrenlambert.com\/"},{"@type":"ListItem","position":2,"name":"WP Engine Redirect Rules"}]},{"@type":"WebSite","@id":"https:\/\/www.darrenlambert.com\/#website","url":"https:\/\/www.darrenlambert.com\/","name":"Darren Lambert","description":"WordPress & WooCommerce Expert","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.darrenlambert.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.darrenlambert.com\/#\/schema\/person\/ba3d82eb3f9925e946dae3b57e35bb79","name":"Darren","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.darrenlambert.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/076d975a0d00c5b2d53e2f76076cf5cf?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/076d975a0d00c5b2d53e2f76076cf5cf?s=96&d=mm&r=g","caption":"Darren"},"url":"https:\/\/www.darrenlambert.com\/author\/darren\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.darrenlambert.com\/wp-json\/wp\/v2\/posts\/1570"}],"collection":[{"href":"https:\/\/www.darrenlambert.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.darrenlambert.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.darrenlambert.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.darrenlambert.com\/wp-json\/wp\/v2\/comments?post=1570"}],"version-history":[{"count":1,"href":"https:\/\/www.darrenlambert.com\/wp-json\/wp\/v2\/posts\/1570\/revisions"}],"predecessor-version":[{"id":1571,"href":"https:\/\/www.darrenlambert.com\/wp-json\/wp\/v2\/posts\/1570\/revisions\/1571"}],"wp:attachment":[{"href":"https:\/\/www.darrenlambert.com\/wp-json\/wp\/v2\/media?parent=1570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.darrenlambert.com\/wp-json\/wp\/v2\/categories?post=1570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.darrenlambert.com\/wp-json\/wp\/v2\/tags?post=1570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}