We had a sloppy web designer who created a new design, they made a /development page on our website by creating a new wordpress install and failed to make it noindex, nofollow so all of our main page is being duplicated in Google under /development.
So I want to redirect all pages found under this directory straight back to the homepage (not strip out only /development)
So this means /development goes to domain.com
and
/development/howtofindhelp.html goes to domain.com (homepage) without the extension.
I tried using this and it doesnt seem to work at all, it basically just adds the trailing slash on the end:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^development(.*)$ https://domain.com/$1 [L,R=301]
For those interested, since I couldnt get the code to work for the header.php I tried something else.
Just edit the wp-config.php and I took off the /development so its just the main homepage. By default when you try to load the page it will jsut say not found. But you can install the 404 to 301 plugin which will redirect all 404 pages.
Since this /development is on its own wordpress install I am fine with it redirecting automatically since the main wordpress install wont have this plugin.