From WPEngineer (with edits):
Add the following to functions.php in your theme:
function fb_change_search_url_rewrite() {
if ( is_search() && ! empty( $_GET['s'] ) ) {
wp_redirect( home_url( "/busca/?s=" ) . urlencode( get_query_var( 's' ) ) );
exit();
}
}
add_action( 'template_redirect', 'fb_change_search_url_rewrite' );
Add the following to your htaccess file:
RewriteCond %{QUERY_STRING} ^s=(.*)$ [NC]
RewriteRule ^$ /busca/%1 [NC,QSA,L]
Note: Code is untested
Edit: Minor modifications made to answer the question more thoroughly
Related Posts:
- Unique URL Every Time
- Custom slug in front of search URL
- How do i change the search permanent links
- add_rewrite_rule not working for language specific characters
- Changing the search URL?
- Rewrite: WordPress URL rewrite on Search
- Force search form to go to clean url without multiple redirects
- WordPress search rewriting
- Change /search to /somethingelse
- Page not found: Custom search form with a custom search page
- WordPress how to prevent URL encoding in URL of taxonomy terms
- Changing the wordpress default search url to something like – …example.com/search?query=keyword
- How to change search page url so that it still returns a page when there’s no search query specified?
- Redirect empty search to another page
- How to add Search URL parameters to a Page Template Page for Custom Post Type
- Why is there a 404 on page 2+ for my search page?
- Rewrite URL for Search + Special Characters / Umlaute
- How to turn off searching from URL and go straight to 404 page
- How to make custom WordPress page deliver search results
- Use a template file for a specific url without creating a page
- Using the Rewrite API to Construct a RESTful URL
- Pretty permalinks for search results with extra query var
- Rewrite Rules for Multiple (more than 2) Taxonomies
- How to add dot(“.”) in post slug
- Using plus (+) sign instead of space (-) in WordPress URL
- SEO Friendly URLs for my plugin categories
- How to create a specific frontend URL (not a Page) from a theme or plugin?
- WordPress keeps writing rewrite rules to .htaccess
- WordPress Rewrite
- custom template for custom url
- Combine Multiple Categories Into One URL Slug
- Multilingual theme: Changing locale based on URL
- Custom rewrite rule for backend/admin?
- Allow single quote in URLs
- How to have multiple rewrite endpoints in the same URL?
- Remove all categories from URL
- change default ‘post’ slug with register_post_type_args
- Add specific word to default page permalink
- Permalink Rewrite for Custom Taxonomy
- Removing “category” from URLs then “add_endpoint()” won’t work…
- Is it possible to generate an alternate structure for multi-tag urls?
- Use single-site install and map entities to subdomains
- Rewrite rule to load images from production does nothing
- How do I change attachment slug from name to id
- Creating a dynamic URL structure
- NextGEN Gallery Lightbox – Social Share URL Redirect
- My WP_options db rewrite_rules Does Not Work
- Rewrite Preview URL to include index.php
- How to disable URL rewriting for specific URLs?
- Custom rewrite_rules – only pass numbers and not alphabetic characters
- How can I dynamically generate an image with a static image URL?
- How to create rewrite endpoints it in author.php?
- Rewrite custom post type URL parameters
- How to remove wordpress directory slash
- Changed pagination URLS to use p= instead of paged=
- React Router with WordPress
- How do I only allow downloads that are referred from my domain?
- URLs with two taxonomies are missing from sitemap
- URL Rewrite and add_query_var not working
- Rewrite permalink for specific posts
- How to change custom post type slug
- Retrieve query var within functions.php
- rewrite rule generated with mpdf to a shorter version
- Name page template properly
- Show Mysql table elements as pages in WordPress
- One off rewrite for single post-type slug (show normal page with same URL instead)
- .htm re-write is adding an ending / to my URL bar
- database not responding on localhost
- Import images from self-hosted to WordPress.com
- modify URL with mod_rewrite or hook
- Trying to add array of paths to post permalink
- How to rewrite URL back to default custom URL if no destination found
- add_rewrite_rule refuses to function
- Creating a custom rewrite for a single page
- How to add logged in username after WordPress URL?
- Dynamic URL with rewrite rule not working
- How to get relative page for every post: /post-1/contact. /post-2/contact
- History API & URL for single long page
- WordPress Rewrite Rule to EITHER Match 1 or 2 Taxonomies when adding to URL
- Display categorised url
- Is it possible to rewrite a page URL from ID to name from an API?
- Dynamic URL Rewrite rule
- Root-relative paths being rewritten on ‘Edit Page’ [closed]
- Rewrite Rule added but showing 404 rather than specified page
- Url wordpress rewrite
- Get parameters and custom page template
- Blog List Page 404 With Custom Post Type Rewriting to Blog Parent
- Direct Dynamic URL in root to a location within template
- rewrite rules social share links
- add_rewrite_rule is not fired
- URLs ending with number higher than 2147483647 redirects to to domain.com/2147483647
- URL rewrite results in a 404, but everything should work!
- Custom URL scheme – paramters on custom post type
- Custom Rewrite for Profiles
- Pagination posts. Url format
- how rewrite is working in wordpress
- How to prevent URL-modification when page title contains digits only?
- How do I display a friendly URL link in the frontend?
- Change the slug ( url ) to a sequence number starting from 0 in the custom record type?
- Change url site.it/wordpress