If /foo
doesn’t exist as a page, you can map the URI to another page with a rewrite rule:
function wpa_rewrite(){
add_rewrite_rule(
'foo/?$',
'index.php?page_id=3',
'top'
);
}
add_action( 'init', 'wpa_rewrite' );
Related Posts:
- flush_rewrite_rules not working on plugin deactivation, invalid URLs not showing 404
- Edit Permalink Structure For Custom Post Type or Modify .htaccess?
- Hidden permalink different from displayed permalink
- catch urls with specific pattern and show specific content for them by plugin
- Redirect url in plugin to somewhere else?
- Add rewrite rule to permalink structure
- Best way to manage a lot of pages in Wp Admin [closed]
- Pages with 2 Columns
- Custom url structure for custom template
- wordpress custom login successful redirect hook
- Nested CPT URLs + Posts 2 Posts
- Is there a way to lock certain pages from being edited by anyone other then the admin?
- Replace existing pages with new pages, keep menu links
- How to show category images (from plugin) on a regular page (page-example.php)?
- flush_rewrite_rules() not working on plugin activation
- [Plugin: Posts 2 Posts] How does it work?
- Copyright messages for a particular set of pages
- How can plugins have their own pages?
- Add a plugin before main container
- WordPress URL redirect
- WordPress Redirect Not Working – AJAX Callback Response Not Picked Up
- View Private Published Page with URL Code (no login required)
- how to change the verification url of pie register plugin of wordpress?
- How can I check if on specific plugin generated page or child
- How to redirect a URL with parameters?
- Redirecting a buddyboss profile tab to a different tab if not subscribed to a specific membership
- WordPress web pages keep getting deleted (moved into the trash) by themselves
- Run plugins only on certain pages
- Redirect already logged in users away from a page to a specific page base on user role
- (FES EDD) New vendor submission page is blank
- Changing page URL and connect newsletter to MailChip
- How to Create a Custom Slug for Tags and Categories with a prefix or suffix?
- URL rewrite of independent plugin?
- Plugin generated taxonomies’ permalinks with custom placeholders
- How do I write an inventory list plugin that creates dynamic details pages?
- Can I allow certain people to add/edit pages within a parent?
- WordPress 4.3 broke meta redirect (with url params plugin)
- Locked out of admin panel after installing HC Custom WP-Admin URL [closed]
- Thesis 2 custom Page
- Creating author Specific page URL
- How can I redirect some pages to new subdomain? [closed]
- Simulating a wp page – wp page load sequence
- Add to array, redirect and display
- URL rewrite with external JSON query
- Get post content from outside the loop with plugin shortcode usability
- WordPress rewrite rules not working
- Custom form not showing in correct place on page
- Use jQuery Datepicker code from plugin
- How to embed a new string in url?
- i want to rewrite my custom plugin url
- Adding a pagenavi to function for displaying bookmarks
- Is there a syntax highlighting plugin for HTML View? [duplicate]
- Modify pages widget and make a plugin?
- How do I create pages within a WordPress post?
- Custom plugin places html head content in body
- TranslatePress | secondary language category/sub-category not working correctly “`/%category%/%postname%/“`
- Pass PHP variable to javascript
- How to permanently show Word Counter on Create/Edit Page. WordPress5.9.3
- Change language on website and change currency with url query
- Copy/paste local images not working in WordPress
- how to show all posts of each category in pages
- create pages automatically and dynamically in wordPress
- Having a problem with rewrite_rules and rewrite_tags – url not rewriting properly and query var missing
- WordPress rewrite rule depend on meta values not ids
- Automatic chage password of pages after some time
- How to update all in-site redirect URLs to destination URLs at once
- How to allow URL with filename & extension in wordpress?
- How to Disable Auto Executing Script in A Particular Page Only
- How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially
- Reverse count page view and show on other page
- How to give .html extension to just one post not all post
- URL Rewrite 404
- Page Contents showing in Footer Area
- .htaccess file doesn’t work, with hundred tries
- I am trying to rewrite urls in WordPress, but its not working
- Add_Meta_box to custom page (formidable edit post)
- Identify if the_post hook is being called from the admin post list
- How to remove a css class for any wordpress page
- Change default url to plugin custom post type
- Clone a Post Tite and Custom Field into Custom Post type
- Custom pages with plugin
- Options page textarea to populate custom post select field
- Creating custom URL for async content
- Better code/text editing for posts and pages?
- URL RewriteRule doesn’t work when using WP Database Participants in my WordPress website
- Restrict my pages from public
- custom url with custom post
- Fake Single WordPress Post (Page) Loop
- How to set different users for different pages?
- Plugin with custom domain
- How to get the real address from a url (permalink)
- How to link that “logged in” in “you must be logged in to post a comment” with custom login page on WordPress?
- Simple WordPress function / plugin to redirect a site
- Remove base from the custom post type URL [duplicate]
- WP Job Manger change jobs url (NOT slug)
- How can I output completely custom content with plugin while still having header, footer, sidebar etc [closed]
- Redirecting to page on form submit – Revue plugin
- How to rewrite URL using .htaccess in WordPress Plugin
- WordPress Plugin and other pages not opening
- Set the Social Icon Size in footer