You can add the following to your .htaccess
file in between the <IfModule mod_rewrite.c>
tags:
RewriteCond %{HTTP_HOST}
RewriteRule ^our-focus/(.*)$ /focus/$1 [R=301,L]
Your .htaccess
should looks like the following:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# Custom Rewrite
RewriteCond %{HTTP_HOST}
RewriteRule ^our-focus/(.*)$ /focus/$1 [R=301,L]
</IfModule>
# END WordPress
As a result it will do the following:
http://example.com/our-focus/test
Redirects to:
http://example.com/focus/test
Related Posts:
- Masking wp-content/themes/name/images to just images directory using htaccess
- Passing parameters to a custom page template using clean urls
- How to add custom rewrite rule to .htaccess?
- Use subdomain for certain urls
- Clash of the rewrites
- How to remove “admin.php?page=” from wp-admin using .htaccess?
- SEO Friendly URLs for my plugin categories
- Hijacking the URL for filtering
- Rewrite rules in .htaccess get overwritten?
- Custom rewrite rules are sending everything to index.php
- custom htaccess rewrite rule for page
- WordPress keeps writing rewrite rules to .htaccess
- WordPress Rewrite
- Dynamic URL, not a physical page within the database
- Redirecting all old links from previous EE site to new WP site in one go?
- Prevent WordPress from automatically correcting URLs
- Two “.htaccess” Files Located in Different Directories?
- Server (WordPress) redirects files that are not supposed to (using htaccess)
- htaccess: Remove trailing slash from URL ending with .xml/ only
- External/non-WP rewrite rule without QSA
- Issue with using .htaccess to redirect feedburner feed
- Remove all categories from URL
- hard flush_rewrite_rules() not regenerating .htaccess
- Map alt domain to specific section of website w/o MU
- Rewrite rule to load images from production does nothing
- Cleanup URL for a custom page in wordpress
- WordPress rewrite rules don’t need ^?
- WordPress SSL (https) is not working with custom permalink
- Changing RSS feed URL structure
- How to redirect http://mydomain/blog/blahblah/ to http://mydomain/blahblah/ in wordpress htaccess?
- add_rewrite_rule fro html to another url not working
- Adding rewrite rules directly to .htaccess file
- Double domain name in category URL-s
- Access files at new location using old file paths
- NextGEN Gallery Lightbox – Social Share URL Redirect
- Url Rewriting a dynamic wordpress page
- WordPress .htaccess blocks mine?
- Preserve Domain Alias
- My WP_options db rewrite_rules Does Not Work
- Disable Pagination on Pages
- Rewrite Preview URL to include index.php
- WordPress Redirecting Non Category Pages /page/nnn to their Canonical URLs
- subdirectory install breaking existing links
- a one-off rewrite rule
- How can I dynamically generate an image with a static image URL?
- How to remove wordpress directory slash
- Changed pagination URLS to use p= instead of paged=
- “View post” leads to odd URL
- React Router with WordPress
- joomla to wordpress migration and 404 errors issues [closed]
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- Map secondary domain to other’s virtual subfolder
- Redirecting /px/?q=x to /px/x/
- URL redirect on updating the post date
- WordPress keeps writing rewrite rules to .htaccess
- Customise particular RSS permalink
- htaccess rewrite, adding segment to url
- RSS feed rewrite matching wrong rule
- ow to change cutsom page url of wordpress site using htaccess
- Redirect htaccess [closed]
- force www rewrite if wordpress put in a folder
- WordPress .htaccess ignore path and subsequent .htaccess files in subfolders
- Overwrite WordPress’s URL rewrite not working
- 404 redirect based on url
- How to customize sub-URLs in a wordpress website (.htaccess)
- How do I make WordPress revise an .htaccess file a certain way?
- Rewrite rule that wp-login.php?action=register is left alone
- Rewrite htacess rule doesn’t work
- Translatepress taxonomy and custom post type root FIX
- WordPress URL redirect and replace ? question mark
- Multiple permalink with and without category for same post
- Custom Params in URL
- Pretty URL via Rewrite
- Fresh install redirects to www, breaking page loads
- Rewrite Url using .htaccess or hook
- Is it possible to rewrite a page URL from ID to name from an API?
- Rewrite URL to get rid of wp-content etc and change URL
- Rewrite URL for attachments
- Moved WordPress to Subdirectory, still hijacking requests to files outside of its directory
- How to add gallery slug to attachment url?
- Rewrite URL query string for all pages
- Url wordpress rewrite
- Add ReWrite from Old Pages to WordPress (remove .php)
- ModRewrite not working properly
- Fully mask *all* traces of WordPress installation subdirectory?
- .htaccess RewriteRule to include post type and taxonomy
- Redirect A URL Pattern In WordPress Using .htaccess
- URL rewrite results in a 404, but everything should work!
- Rewrite Question
- Simple URL rewriting gone wrong
- Stop wordpress to redirecting home page if no page found
- Additional .htaccess rules based on wp page
- What is the proper way to use add_rewrite_rule to remove the (question mark)?
- Changes done to .htaccess are not getting reverted back
- WordPress total posts per page changed and now 404 Http error comes out [closed]
- How to redirect a virtual page (e.g. /blog) to the home page?
- how to rewrite folder name in url to another name
- Add rewrite endpoint and .htaccess
- Rewrite Page Parameters
- WP-Include rewrite directory