Sometimes this would be achievable with add_rewrite_url
but it looks like in this case it’s not as you need to redirect to a different domain.
In this case you need .htaccess or nginx rules to do this, so you need to add something like this to your nginx config for domain.com only, in order to rewrite those URLs:
rewrite ^/resources/(.+) https://materials.domain.com/$1 permanent;
You’ll likely need to restart nginx after you add this to the config file.
Happy to help if this doesn’t do exactly what you want. There’s more examples of nginx rewrite rules here: https://www.thegeekstuff.com/2017/08/nginx-rewrite-examples/
Related Posts:
- WordPress Multisite Network Shared Custom Post from Main Site using single-CPT.php
- Custom post type single-{custom}.php not working
- What is singular.php?
- Conditional for single-{post-type}.php
- Template for specific post of custom post type
- Custom Post Type, WP_Query and ‘orderby’
- Templates for Custom Post Types and Custom Taxonomies
- Pre get posts for single post
- Pull Two Posts Into Custom Post Type `single-cpt.php`
- is_singular() not working if called via callback function of admin-ajax.php
- Create sub single pages
- Using previous_post_link and next_post_link to wrap around post sequence
- WPMU: Programmatically adding CPT posts to specific blog id
- How do I create new content pages for my Custom Post Type?
- Display “Post 2 of 4” on single post page?
- Post Rank on Single Post page based on custom field
- Disable single pages and archives and keep preview
- Displaying Meta Box Image
- Custom template for post type not working
- Make custom post type display as a page
- Rewrite Custom Post Type URL slug
- Multisite with a single, shared custom post type, while retaining site URL
- Multisite custom post type’s single page 404
- Sub-Sub-Blogs — creating and importing content into a custom sub-type
- Disable single view in register_post_type [duplicate]
- Remove default post types on all sites except primary blog. WPMU
- Need post_type_archive_title function but in ‘single’
- pagination redirecting from page number url before page requested
- Need to display same custom post type on 2 different singles templates
- Made Custom Post Types, but single.php not working
- How to call custom single post?
- Custom post template for particular posts
- Plugin for custom posts and fields [closed]
- Custom Taxonomy Invalid in REST API
- Remove single page for custom post type
- Single Template that can be applied only via URL
- How do I display tags for a custom post type single page?
- wp_insert_term in a multisite installation
- custom post type parsed as attachment
- Single template showing all posts of that type
- Programmatically rewriting slug through functions.php but returns 404
- WPMU: Cross site custom post type
- How to display single post from custom post type loop?
- Setup template_redirect using has_term when NO term assigned
- Multiple pages for posts?
- How can you use one database with multisite
- Multisite: How to define and limit a Custom Post Type to specific sites?
- Flush Rewrite Rules when new site is created on network
- Not Able To Render Single-CustomPostType.php File
- Single page not working for custom post type
- Get term name without a foreach loop
- Cant get paginations on single.php to work with my custom post types
- Including all post id’s of a custom post type into an array
- Display custom post types in wp_list_pages
- List of users that clicked a ‘Join’ button at single post
- Inserting custom fields into single.php
- hide specific div on single.php [closed]
- How to use single.php for creating, reading and editing Custom Posts with ACF
- posttype and custom fields on multisite
- How to show custom field on specific custom post type posts only when filled
- adding custom post type “name” to single template
- trying to show single post but displays all post on a custom post type
- Custom Post Type Specific Post Template
- Using custom post types WordPress network
- Function to allow single post template based on custom taxonomy?
- Conflict in function to allow single post template based on category
- Two-way synchronizing of a post type among multisite blogs
- WordPress giving me the index
- Loop all post on single.php
- Custom post type single page 404
- How can I write slugs / permalinks as: custom post type -> custom taxonomy and custom post type -> custom taxonomy (one CPT and many taxo)?
- Custom Post type not Querying in switch_to_blog loop
- get_the_terms child terms for current post/custom post only
- Adding a Section for Visitors
- Why custom post redirecting to index page?
- Assign for all post of a post type a specific single-post template
- custom post type single page
- custom post type single post preview for pending status
- Making permalink for custom post type/custom taxonomy. Stuck with 404 in the single post
- How to show data content from single page which is from custom post type?
- Custom Post – additional param in the custom post URL goes to error page
- How to get adjacent_post custom_field value
- Single Page of Custom Post Type Not Showing the Content Of post
- Edit single page from plugin
- Main site single-property.php design, as homepage of a multisite
- DIVs not showing correctly on CPT?
- Display Taxonomy Term for CPT on single-CPT.php
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- Shared Custom post type between WP network sites
- Custom post type single display is ommited
- Single page problem when permalink type changed
- Two single.php files?
- Multisite – Echo admins profile meta
- Single Page for two custom post types
- Query child posts on parents single.php?
- install.php Custom Taxonomy Term not being added to custom post
- How to make a list of posts displaying them 5 by 5 with a “next posts” link?
- is_singular won’t call my functions?
- Can I have a specific template for products even if they are standard posts and not CPT?
- Create WP multisites as a custom post type