But I want change url to https://cdn.domain.com/favicon.ico, How setting this url with rewrite rules in PHP.
You can’t. That’s not how WordPress rewrite rules work.
add_rewrite_rule
is used for mapping pretty permalinks into the form /index.php?queryvar=value&etcetc
.
Most servers don’t even load WordPress to handle requests like that for assets and skip PHP/WordPress completely for performance reasons. Doing this will require Nginx/Apache level changes above/outside of WordPress
Related Posts:
- Customize default settings on new sites on multisite
- Can I write ‘RewriteCond’ using ‘functions.php’?
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- How to call plugin function per site in a multisite?
- Redirect to another page using contact form 7? [closed]
- Moving code from theme header to functions.php
- wp_redirect only works on main site and not on other sites
- List all blogs, but exclude the main site
- Is it legal to redefine wp_password_change_notification in a mu plugin?
- How to Redirect Buddypress Directories To Login Page For Non Logged in Users
- bp-custom.php is not working on a WordPress multisite environment. how to fix it?
- Remove node from multisites?
- PHP script to redirect traffic based on website accessed
- use system script advertising in wordpress multisite
- I need a button to appear when not loged in and another when logged in, I need help fixing code PLEASE!
- Displaying Logged-In User Name in WordPress Menu
- Set media upload attachment link to none and hide it in WP v3.5
- Fatal error: Call to undefined function plugin_dir_path()
- Switching wp_get_sites to get_sites
- Integrating WordPress to my website, while keeping my own authentication system
- How to use wp_insert_user on WordPress Multisite?
- One button to change all settings in theme customizer?
- Add custom image sizes to media uploader
- How can update custom meta for all posts
- How to add default images into theme customizer image control?
- Is $hook a global variable in WordPress
- Successful or Error Message after running mysql code in functions.php
- Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
- Include a php file from functions.php only to homepage
- How do I fetch all comments per post via WP REST API?
- Shortcode content output but not in correct place
- How to restrict page access to logged-in users?
- Handling Body class based on Template
- Adding Default Settings to Theme My Login plugin
- How to add values to media “whitelist_options” in wp-admin/options.php template?
- Automatically adding new post categories to menu
- Get post id in a function when edit/add a post
- function to assign user role based on a field from usermeta
- get author_name from queried post
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Append query string to all URL’s
- Pass php dynamic variable to shortcode
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- How to list posts from a plugin taxonomy?
- Filtering a function’ output for a new continued function
- Shortcode to find and replace URL
- Deleting Certain terms from appearing on the front end as links
- first instantiated SimplePie object cosumes 5mb?
- Theme not calling Jquery properly
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- WordPress redirect redirecting too many times or not at all
- Shortcode to embed Edit Account form not working
- How to make jquery count down timer function manually editable
- Hierarchical taxonomy list with modificated term links
- Add value to new attribute inside WordPress menu items
- Please show me how to use an if/else statement in combination with wp_enqueue
- If Array Values Match Another Array’s Values, Then
- entire JS folder not loading in a WP theme
- Open and closed function [closed]
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- Else/If Statement to Display Photo Descriptions
- Count foreach and display in menu php
- need help adding a new sidebar to a page that can’t use page-templates -> multisite
- Strip from or something better?
- Display additional page templates and a sidebar on plugin activation
- How can I fix this code [duplicate]
- Remove role of user after X days
- Add a Metabox checkbox to the Page Edit screen of wp-admin , which only certain roles can see and Makes only certain roles able to Edit said page
- how to replace h1 entry title with h2 in category pages only
- How to unset a function from a action inside a class, that is called in another class
- Create a new account on site B with data from the purchase of site A
- Why is the current page loaded in the pop-up window and not the specified one?
- if get_post_meta is empty echo a placeholder or shortcode
- PHP multiple forms, same page, isset($_POST[]) not working?
- Outputting post content to jQuery .html() string
- Internal Server Errors – Moving working multi-site install to my localhost
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- post_exists stops working in a scheduled event
- Where do I implement this display of User Meta Data, and how to put it in a table?
- Redirect user role to a specific page on login in a multisite network?
- Add ID to output only for first option
- Add .php to end of all WordPress Pages (multisite)
- How to add custom text near category/tag title in WordPress Twenty Fifteen Theme?
- Issue encountered while trying to keep website private
- Display text of price (minus 20%) on every product page in a sentence.
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- How to make 2 similar functions more efficient
- Echo multiple tasks if a common function exists
- wp_delete_comment is doing nothing
- Add end mark at the end of every article
- Custom meta box save values issues – Deprecated: Function ereg() and more
- Ninja Forms – pull in some post related information
- Functions are causing errors
- Global variables and re-use
- Issues separating my Plugin pages into different files
- Link to external page has wordpress blog-url inside
- AJAX: WordPress filters inside $html do not work as intended
- Appending an ACF custom field to the page title