How can I redirect from a Permalink to a new permalink? - wordpress

To add more detail, my current situation is that we are moving from Symfony2 to Wordpress (resources choice). Usually the redirect would require a relative link as source and a permalink as destination.
Let's call the domain http://example.com
Users with old links such as http://example.com/article/[id] need to be redirected to the new urls which is something like http://example.com/title
We have around 200 links that require redirecting and as you can see the new urls don't allow much for automating the process. My issue is if we set the .htaccess under the old installation and change the domain for it to example2.com, none of the users will ever stumble on it to be redirected.
Which leads me to ask if its possible to have a permalink on both ends of the redirect. I am open to any other suggestions to how to tackle the issue, except the old and new url formatting can't be changed in the current situation.

It might not be the most efficient way of doing it but, I get a list of all the links I need to redirect and a list of the new urls they are directing to and do a 301 redirect in the htaccess. This will change all indexes on google so they will show up without any issues.
Redirect 301 /article/1 /title

Related

Redirect 301 wp url based on year/month/day to post-name.html

I recently changed the permalink structure from
https://www.domainName.ro/2018/04/10/post-name.html
to
https://www.domainName.ro/post-name.html,
using:
"RedirectMatch rule 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/([^/]+).html$ https://www.domainName.ro/$4.html" and works.
Now I want to redirect, within the same site (old URL), the URLs from
https://www.domainName.ro/2018/04/10/post-name/
to
https://www.domainName.ro/post-name.html
I tried different rules and did not work.
The two rules must work at the same time on the site
Can you help me?
Thank you very much!
You can manually change the url using wordpress plugin called redirection after install the plugin you can simply add url which you need to redirect from old to new just simple go to tools and there you find redirection click on that and you will find 2 box in 1box you need to enter old url which you need to redirect and 2box you need to enter new url where you need to redirect and click on save and you are done redirecting
Hope this will work for you

Drupal URLs migrated to new WordPress installation

We have an existing Drupal site. That is going to be replaced with a WordPress site on the existing URL. However, there has been a lot of SEO done on the drupal URLs so a google search will return those old URL's. We want to redirect to the new corresponding URL in the Wordpress site. However, since the drupal site is no longer live on the existing domain, the old URL's will just return 404 and cannot be redirected since they are not relative to the WordPress root. Is there a way to do this? Do I need to get those old drupal site URLs into WordPress somehow?
First of all you need to update your sitemap and add canonical's for permanent redirections. This wont directly redirect the page, but will let the search engines know that the url for the page has been changed and hence will avoid loosing your search engine rankings.
Then for actually redirecting the page you will need to update your htaccess
Redirect 301 /folder/oldpage http://www.example.org/newpage
If there are lots of pages you should consider using a wordpress plugin called redirection. This way you dont have to update the htaccess manually, and it will also keep logs of all the 404 pages that users have found, so you can also keep an eye on logs for any missing pages and redirect them accordingly.

Redirect Ecwid URLs with fragment identifiers to new Woocommerce URL

I recently migrated a client's e-commerce site from Ecwid to WooCommerce. Ecwid's URL's use fragment identifiers which is now a problem as I can't set up a 301 redirect to the new URL using .htaccess. As I understand, everything past the # isn't accessible to .htaccess.
I'd like to try and preserve their SEO ranking as well as easily update all the old URLs to new.
There are dozens of Wordpress plugins which offer the ability to redirect pages, but I'm concerned I'll have the same issue. From what I've read Javascript redirects don't use the 301 response code, so search engines wouldn't know what the new URL is.
Is there any other way to redirect this:
example.com/products/#!/100-Cotton-Sash-Cord/p/19877065/category=4619310
to this?
example.com/shop/all-natural/100-cotton-sash-cord/
As you mentioned, everything after the # isn't processed by the server.
However, if your old site was previously indexed completely by Google, you can presumably pick the "ugly" URLs for the snapshot pages and redirect those?

301 old site to new with lots of url structure changes

I will soon be 301'ing my entire site to its new home on a new domain, where it will live as a subdirectory of the main domain. It lives at the root of its current domain. Now, if every single old page had the exact same url structure as every single new page, the redirects are trivial. However, of the 200ish old urls that will need to be redirected, very few will exist at their new site "equivalent" (www.olddomain.com/somepage -> www.newdomain.com/olddomain/somepage) as most pages will have either a slight url change or exist somewhere else entirely, like at the root of the new site.
I'm assuming 200ish lines of specific singular 301 redirects in .htaccess would slow down the site pretty bad since .htaccess is loaded for every asset on the page, correct? As would (relatively) complex conditional logic with mod_rewrite?
Any ideas?
Side note: both sites, new and old, use WordPress, so if there are any WordPress-specific solutions, fire away.
It depends on your traffic, if it is a personal blog, then mod_rewrite should be fast enough for users not to notice.

Automated 301 redirect for any missing pages within specific directory

I am trying to help a friend move a Wordpress site to a new server. However, it has many old blog pages that he'd like to have deleted.
Instead of doing a 301 redirect for each and every blog that is about to be deleted back to the blog main page, is there a way to automatically create a 301 redirect for any of the missing pages of that directory only?
For example, any page that does not exist at www.website.com/blog/... would be automatically redirected to www.website.com/blog/ (not homepage)
However, for any other page such as www.website.com/otherdirectory/... would be treated as a regular 404 page.
Hope this makes sense.
We have Urban Giraffe's Redirection plugin installed for one off redirects already. Would be super if the other blogs to be deleted could be fully automated.
Thanks in advance.
Found my own answer (sort of) - hope this can help others:
Auto Redirect 404 in 301 for Trashed Posts
http://wordpress.org/plugins/auto-redirect-404/
There are a few caveats though. This plugin monitors what you are about to delete and then automatically creates a 301 redirect. Note that this does not help with already deleted posts.
Note that I have installed this, but I have now removed it after doing all of the deletions. Once I deleted all the unnecessary posts, it created a list of the 301's. I have copied this list then imported them into the Plugin below so that it can be managed by 1 plugin. Also, the issue I have with this plugin is that it also monitors media and pages. This means that if you delete a page (ie ...com/test/) it will make a redirect - however, if you create a page again later with the same URL (ie ...com/test/) that page will no longer be visible as the redirect has been created in a table of your database. This plugin does NOT let you undo a redirect. If you deactivate the plugin, the 301's will stop working so that is the only way to stop the redirects. All or nothing.
To manage other 301's and to turn on and off redirections for single pages, I use:
Wordpress Redirection:
http://wordpress.org/plugins/redirection/
This will allow you to add 301's for other urls. This also allows you to import a CSV. I have created a CSV with the list created with the above Plugin and imported into this for better management.
I have also turned off "monitoring" in the options section (Don't monitor) so that it will not accidentally create a bunch of unnecessary redirects. For example, if you create a blog post with this url: ...com/test/ and change it to ...com/test2/ it will automatically create a redirect. This means that later in the future, if you create a page ...com/test/ you will not be able to view it. It will always redirect to ...com/test2/. This kind of automation can be troubling if you forget this monitoring is on.
Hope this helps.
If anyone knows of a better way to automate any missing page from a particular directory, please let me know.

Resources