How to Redirect Dynamic URLS in Wordpress - wordpress

I have a WordPress website and I installed wordfence plugin which caused duplicate URLs in google, I deleted the plugin but those URLs are still there and working. so I want to redirect them to eliminate duplicate page issues. there are multiple URLs that need to be redirected.
how can I redirect those workforce URLs via htaccess? below are some examples
I want to redirect this
https://www.example.com/page/2?wordfence_lh=1&hid=10813D53CD849633351F7F5195D75319
to this
https://www.example.com/page/2
and
https://www.example.com/page/22?wordfence_lh=1&hid=10813D53CD849633351F7F5195D75319
to
https://www.example.com/page/22
there are multiple URLs but they all have ?wordfence_lh=1&hid=xxxxxxxxxxxxxxxxxxxxxx
I tried multiple solution found on internet but they didn't work

Related

WordPress domain redirection

Beginner question:
I need to perform a 301 redirect from one Wordpress site (domain), to another Wordpress domain, like this:
From:
http://mycompany.com
To:
http://mycompany.se
A problem is that I have no FTP credentials for my From-site. I can't reach the .htaccess file.
Is there a plugin to use? I have studied the Redirection plugin, but this one seems working on pages within the same domain only(?)
I guess I need to be careful, because if some plugin edits the .htaccess file and something breaks, I can't reach the file...
Thankful for any help!
Whit Redirection Plugin you can redirect a url from old to new website.
You can create and manage redirects quickly and easily without needing Apache or Nginx knowledge. If your WordPress supports permalinks then you can use Redirection to redirect any URL.
There is full support for regular expressions so you can create redirect patterns to match any number of URLs.
The plugin can also be configured to monitor when post or page permalinks are changed and automatically create a redirect to the new URL.
You can easily find multiple plugins to perform 301 redirection in wordpress,but if you want to edit .htaccess you can install the plugin called "WP htaccess control" https://wordpress.org/plugins/wp-htaccess-control/ .
Through this plugin you can edit the .hraccess file from admin side.
Thanks.

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.

Can not redirect php pages on WordPress multisite

I have been battling redirects all day. We have a customer with an old site, and all the old php links are broken and will redirect you to a 500 error page.
I have tried 3 different 301 redirect plugins all with the same result - regular pages will redirect, and .php pages will not.
I have also tried to redirect from /folder/file(.*) - but with no succes.
This page is made on a WordPress multisite installation so i need a solution where i do not have to add all redirects in the .htaccess file.

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?

How to modify .htaccess file to rewirite https to specific pages and directories for WordPress site?

None of the answers i searched on Google and this site give me the correct answer. It was either because it wasn't for WordPress based platform or it wasn't for pages permalinks.
Anyway, my site using permalinks to get better SEO performance over the regular page ID names. I have one specific page that i want to secure with HTTPS (SSL Socket), a directory under /wp-content/themes/my-theme (/wp-sec), and of course the /wp-admin directory/folder and /login.php page. All the other pages should be HTTP even if i will try to write the link as HTTPS.
The specific page ID is 3519 (/?page_id=3519) and it's permalink is "test".
PLEASE, if you don't know and you are not expert don't answer this question.
Thanks.

Resources