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
- How to disable the single view for a custom post type?
- Custom post type single page returns 404 error
- Custom post type single-{custom}.php not working
- What is singular.php?
- Conditional for single-{post-type}.php
- WPML with WP_Query serving up all 3 languages [closed]
- Template for specific post of custom post type
- Custom Post Type, WP_Query and ‘orderby’
- Single custom post type page redirecting to 404 page
- Templates for Custom Post Types and Custom Taxonomies
- Multisite wide post type?
- 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
- Disable Single Post View for Specific Taxonomy on Custom Post Type
- How to get a list of term names of the custom post type im currently on in single.php
- is_singular won’t call my functions?
- Create sub single pages
- Using previous_post_link and next_post_link to wrap around post sequence
- Querying Posts by Taxonomy From Alternate Network Site
- 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?
- posts_nav_link on single post template
- 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
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- Rewrite Custom Post Type URL slug
- Multisite Global Custom Posts
- 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]
- Custom Post Type vs. User Page
- Remove default post types on all sites except primary blog. WPMU
- Archive page for custom post type not working
- Need post_type_archive_title function but in ‘single’
- pagination redirecting from page number url before page requested
- How to check the terms in single custom post type template
- How to show the archive / post type description on Single templates
- Need to display same custom post type on 2 different singles templates
- Made Custom Post Types, but single.php not working
- Posts of custom post type load the page template
- 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
- How to set up multisite for multi language?
- Custom post type not displaying content from single-{custom post type} page
- custom post type parsed as attachment
- How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/
- Single template showing all posts of that type
- Programmatically rewriting slug through functions.php but returns 404
- WPMU: Cross site custom post type
- Displaying All Posts of a Custom Post Type in WordPress Multisite Backend
- 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
- How to set class to “current-page” on the currently viewed single post within a CPT
- 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?
- How to display category wise posts on seprarate template
- Pulling in Related Posts based on Post Type array
- Shared Custom post type between WP network sites
- Custom post type single display is ommited
- Single page problem when permalink type changed
- how to load custom single.php?
- Two single.php files?
- Multisite – Echo admins profile meta
- Single Page for two custom post types
- Conditional Tags If Custom Post Parent & Child?
- 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?
- Fatal Error WordPress Custom Post Type UI + WPML
- Create WP multisites as a custom post type
- Custom post type single page fine for admin, 404 from front
- Can Multisite and Custom Post Types work this way?
- Post URL redirecting to homepage
- How can i show multiple post on single post wordpress, just like therichest.com or screenrant.com or hotcars.com.?
- Custom Post Type – archive working – single is not
- Multisite permalink issue
- How to Insert Elementor Elements with CSS and JS into a Custom Post Type Using wp_insert_post()? [closed]
- Adding a new custom post type using the editor causes 502 bad gateway error
- Change the WordPress database prefix on the fly?
- Change the WordPress database prefix on the fly?