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?
- Redirecting a buddyboss profile tab to a different tab if not subscribed to a specific membership
- How to delete page by deactivating plugin
- 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
- Custom rewrite rules not working with WPML
- How to fix the woocommerce – adaranth.com redirection issue [closed]
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- Rewrite rule not matching
- WordPress plugin/theme or other wayout to create portable pages?
- php page not found for plugin options menu
- Changing page URL and connect newsletter to MailChip
- WordPress page and plugin list using sql query
- Create page from plugin, but have it completely hidden
- Passing the JQuery string to Worldpress URL
- How to Create a Custom Slug for Tags and Categories with a prefix or suffix?
- How to add subcategories to the blogroll?
- 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?
- Proper way to replace the_content only for pages created by custom plugin
- Add menu page issues (permissions & position)
- Display Custom Field Value on Admin Page Column
- Would Gutenberg be considered a PlugIn?
- I need help locating a URL that is on my site map, but that I can’t find in my WordPress dashboard
- How to use login_redirect with a user capability
- Show author on every sub-page
- Removing Automatic Redirects Without Plugin
- How to have sample page for each new register users in a membership website
- One sub site is slow while all others load fine, same theme & plugins [closed]
- WordPress 4.3 broke meta redirect (with url params plugin)
- Locked out of admin panel after installing HC Custom WP-Admin URL [closed]
- How to create a page with links to other pages that include image and excerpt?
- Custom url rewriting
- How to customize a title by passing query string?
- Thesis 2 custom Page
- WordPress plugin url for form submit
- Making my plugin create a page?
- Creating author Specific page URL
- Mask and Track Outbound Links
- Add Content to Content()
- 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
- How to create wordpress page that lets users create their own quiz? [closed]
- Huge number of 404 pages getting spawned
- Username Variable in custom links?
- Get post content from outside the loop with plugin shortcode usability
- WordPress rewrite rules not working
- How to rewrite URL and get the values?
- How to create plugin auto create page wordpress?
- Conditional custom redirect
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- Custom form not showing in correct place on page
- Change website directory safely to add a static page on startup
- Price comparison table based on Custom Post Type?
- Use jQuery Datepicker code from plugin
- Making the ‘add to cart’ button redirect to PayPal
- PHP mobile redirect Endless loop
- How to dynamically change spots of text in custom page?
- How to embed a new string in url?
- Custom page in plugin visible in menu
- i want to rewrite my custom plugin url
- rewrite file to wordpress
- Adding a pagenavi to function for displaying bookmarks
- wp redirect 301 not working in wordpress page
- Preserve Search engine index while shifting to new Domain
- Is there a syntax highlighting plugin for HTML View? [duplicate]
- What is the best way to make a custom page from a plugin?
- Setting text widget to one page only
- Pasting this PHP breaks my page. Why?
- Modify pages widget and make a plugin?
- How do I create pages within a WordPress post?
- Gantry Framework: new page loads homepage content instead of page content
- Janrain/Simple Modal under Redirected Domain
- Woocommerce checkout page broken when set as a checkout in woocommerce settings [closed]
- Elementor Combined all Sections into 1 Text Editor
- Custom plugin places html head content in body
- TranslatePress | secondary language category/sub-category not working correctly “`/%category%/%postname%/“`
- Pass PHP variable to javascript
- Dynamic URL Rewrite for Custom
- How to permanently show Word Counter on Create/Edit Page. WordPress5.9.3
- Displaying page content from plugin, inside exising empty WP page
- Oops! That page can’t be found
- Redirect unloggedin users
- Change language on website and change currency with url query
- Copy/paste local images not working in WordPress
- Use get_pages() before another plugin modifies it
- how to show all posts of each category in pages
- add_rewrite_rule to load different page, without changing URL in browser
- Elementor: How to design Dropdown Select Box Navigation page like Chegg
- login form should redirect to register page for in 1st login next time it should redirected to home page