I fear this may be too much to ask here, so if so, please feel free to tell me of another place to learn.
Help with Redirections
I'm cleaning up a badly developed site and migrating wordpress from a subdirectory. I've spent hours trying to wrap my head around the logistics of redirections and regex. I think I'm getting a handle on it, but would really appreciate confirmation that I'm doing this right, and any advice on best practices. If anyone knows of any good tutorials with how-to examples, I'd appreciate that too.
If anyone knows of really simple plugins for this, I'd be extremely grateful. I've been looking at the Redirections plugin, but find it very confusing (headache!). In any case, my ideas below (sources are followed by => then target) are what I've gathered from the Redirections instructions and screenshots and other tutorials I've scoured. I'm pretty sure that they'd be applicable regardless of whether I put them directly in the .htaccess file or use Redirections or another plugin?
So, here's what I'm trying to accomplish and how I think it needs to be done :
To move Wordpress from the subdirectory to the root:
/wp/(.*) => /$1
For all pages currently within subdirectories in the root, I want to delete and/or combine a bunch of pages into one top level page:
/products-directory/(.*) => /products-top-level-page /about-directory/(.*) => /about-top-level-page /services-directory/(.*) => /services-top-level-page
For a bunch of top-level pages matching a specific pattern, I want to direct them into specific categories, e.g. the file names all start with the same two words like this: same-word-variation-variation.html and I want them to keep their existing file names -- if I set my permalinks to end with `.html`, this will work, I believe:
/same-word(.*) => /newcategory/$1
How would I create the rule if I don't have permalinks ending in `.html`? (I think I saw ! is the "not" character, but not sure how to use here -- is it):
/same-word(.*) => /newcategory/$1!\.html
And then, once I have the specific pages identified and redirected as above, I'll be deleting all the rest (garbage) and want to send users to the home page (or maybe a random post?).
So, 2 questions here:
How do I create the rule that says "for everything except the files already redirected as above, do this"
How would I stop that rule from applying to new pages and posts I create from now on?
One idea is that by deleting, I'd be getting a 404 page not found, so I should create the rule for the 404 page itself? Is that what I want to do?
As I've said, the site has been badly developed (with the client instructing people to just "throw up a page" with no regard for proper architecture, SEO, etc.) -- it has virtually no ranking or external / back links to worry about, but I want to understand the best approach from an SEO and proper development perspective.
- Also, should I move existing images etc. into the wp-content directory or leave them in their existing sub-directory/ies? My inclination is to really go for a 'clean-sweep' - get rid of everything that seems untidy, but I'm not sure if this would be more work than it's worth…
Thanks in advance for any and all guidance.