Add the following to your theme’s functions.php file, making sure you replace the example CDN URL with your own:
function my_cdn_upload_url() {
return 'http://mk124.yourcdn.com/yoursite/wp-content/uploads';
}
add_filter( 'pre_option_upload_url_path', 'my_cdn_upload_url' );
Related Posts:
- How does WordPress handle permalinks?
- Get page permalink without wpurl
- Can I use REST-API on plain permalink format?
- How to change ‘with_front” key from an existing custom post type?
- Permalink not working for page without title
- Post titles not letting me use 2 consecutive dashes in permalink
- Make post slug have priority over category slug
- Adding anchor to paginate_links + Safari anchor bug
- How to stop permalink redirects for a particular slug
- 404 on category.php pagination
- flexible rewrite ‘ramble’ URLs with WordPress
- Posts not working on windows after changing permalinks
- Custom permalink structure
- How to get rid of index.php?
- Relative or Absolute Paths for Flash Video Player Files
- Remove Custom Taxonomy Slug from Permalink
- WordPress Links Not Working After Migration
- Migrating WordPress blog to New Webhosts, something is adding a # and gibberish
- .htaccess – Redirect duplicated post ended in ‘-number/’ to the same url without the -number/
- WordPress Permalinks on Mac OSX Server 5 (El Capitan)
- Adding File Extensions to Attachment Page Permalinks
- How to find out who handles a permalink?
- Permalink /%category%/%postname%/ returns 404 on OSX
- Page Attachment Permalink Structure based on Menu Order?
- How to tranform Headlines into linkable permalinks?
- Best way to add internal link in widget
- article pages not displaying on local instance of wordpress site
- breadcrumbs & rel=”nofollow”
- Use Regular Expression to get tag from permalink url during wp_rewrite in generate_rewrite_rules
- Permalinks for pages
- Create unique alphanumeric ID on wp_insert_post
- Programatically changing post’s permalink when identical post type is published
- Permalinks not working with Vagrant
- Remove parent category from permalink but keep breadcrumbs structure
- Is there a link parameter that will show me all my published pages?
- Add prefix to page URL based on the page template
- Files rendering adding “.x95527” before file extension [closed]
- Permalink /%postname%/ doesn’t work
- How to change hierarchical page permalinks to be flat
- Permalink structure with $_SESSION variables
- Relative v.s. absolute URLs: which ones should I use for cross-domain portability?
- WordPress 3.1 .htaccess contents keep dissappearing?
- Permalink in WordPress loop outputs for each new line
- Freeze child page URLs so parent permalink changes don’t give 404s?
- New custom PHP pages are getting 404s
- What causes /pages/ to appear in URI, and how to remove it?
- How Do I get the author’s page id?
- WordPress Installed But Not Showing Up! [closed]
- Echo title with permalink
- Importer failed to import posts as format “day and name”
- Adding a prefix to the blog, but only the blog
- Old site posts broken after domain update
- Redirect From Url To Url
- Moved site, Old links in pages still pointing to old host
- help to remove last trailing slash using add_rewrite_rule
- change WordPress permalinks and redirect new urls 301
- Changing permalink structure and domain
- Permalinks not working in WordPress
- WordPress Permalink Redirect 301
- problem with pagination in custom permalinks
- permalink error when modifying sanitize_title_with_dashes function
- The requested URL was not found on this server [closed]
- How to create posts or pages with the names in wordpress?
- Xampp 7.3.3 fresh install of WordPress 404 pages unless permalink is set to plain
- Make the blog page a child of another page and rewrite the blog url
- WordPress slug confusion
- How to construct a dynamic rewrite rule for child pages that passes more than one query var
- Extending page urls without getting a 404
- Permalink conflict with React Router in subfolder
- 404 on pretty permalinks when serving via HTTPS
- Permalink structure has suddenly changed
- How to experiment with permalink structure on a select number of posts
- In a multisite, how can I get posts from one site and display their permalinks in another site?
- Why does page for hierarchical taxonomy parent term go 404?
- Custom permalink gives 404 error only in some pages
- Can I link to content dynamically from a page to a new page?
- Question About Permalink in wordpress
- Custom permalink for one category
- Create new URL structure for custom post types
- No Ones Been Able to Override my WordPress Rewrite Rule Issue!
- Remove index.php from URL (WP installed in subdirectory)
- Page returns 404 for specific permalink
- issue with the_permalink
- Single.php not loading when permalink only contains date information
- WooCommerce product permalink changed
- Different Permastruck Between Ajax Request & Normal Request
- Imported posts using wrong domain name
- Problem with multiple tags in URL
- Custom Permalinks and filters?
- Custom WP permalink structure
- 404 error on second page load for child-pages
- Permalink structure as code in back-end?
- Internal Server Error every time I push up my WordPress Project to Heroku
- WordPress custom permalinks, pages are now 404
- WordPress home page showing 404 error
- Include language variable in url
- Is it posible to translate a url prefix?
- AllowOveride All causes assetts and Admin Urls to 404
- Page permalinks are http but show up as https?
- My permalinks no longer have the “news” category prefix in the link and it’s causing 404 errors for articles published on the web