Can not redirect php pages on WordPress multisite - wordpress

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.

Related

How to Redirect Dynamic URLS in 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

Cache keeps making users go to my old web url

My home page used to be www.example.com/index.html, because I was on the Weebly platform. I then switched to Wordpress, where the home page should simply be www.example.com/home.
However, I realized if I visit the URL on a browser where cache hasn't been cleared for the past 24 hours, the website automatically redirects the user to www.example.com/index.html. Is there a way to fix this? I've Googled ways for about 2 hours and tried various Wordpress plugins...
Create a redirect in your wordpress site from /home.html to /home
Just delete old index.html and add this to your .htaccess file in root
RewriteEngine On
Redirect 301 /index.html http://www.example.com/home

Change only the home URL in my WordPress site

I have a WordPress website and the home page is configured to be the latest posts
What I want is that only the homepage URL that is, e.g. www.test.com redirects to subdomain.test.com and when the user needs to visit the older homepage will only access through test.com/home.
I need this because we will start a campaign in a landing page (subdomain.test.com) today.
But this is only for a few days, it is not a permanent change. How can I achieve this?
you can create a new page in WP where you can redirect to your sub domain.
OR
you can do this to make some changes in .htaccess file
RedirectMatch 301 ^/$ http://newsite.com.in/
add this in .htaccess file

301 redirect in htaccess not working as expected

I am trying to add a simple 301 redirect to a website's htaccess, but no redirection is occurring, nor am I encountering any errors--can anyone shed some light? The redirect would redirect people visiting an old blog post to a new page:
old blog post: https://www.horizonhomes-samui.com/horizon-homes-construction/
new page: https://www.horizonhomes-samui.com/construction/
The redirect code I'm using is:
Redirect 301 /horizon-homes-construction/ https://www.horizonhomes-samui.com/construction/
Possibly Relevant Info
My site is a Wordpress site.
I also tried adding a "RewriteEngine On" line to the top, but that did not resolve the issue.
The htaccess file I'm editing is located in my WordPress root directory (along with wp-content, wp-admin, index.php, etc).
The instructions I'm following for adding the 301 redirect are from this guide.
Thanks.
When you don't have a lot of control over the server, which is the case for a lot of wordpress sites, a plugin is better than trying to update the .htaccess file.
I am sure there are a lot of good plugins that do this. This one has worked for us.
https://wordpress.org/plugins/redirection/
With the help of my server admin, I ascertained why this 301 redirect was not working. It is because my site is on an Nginx server, so any redirects added to htaccess will not be read by the server. My server admin was able to add the redirects properly.

WordPress 301 redirects for 300 links to redirect in .htaccess?

my question is would it slow my website? I am migrating from a non WP CMS to a WP CMS which means there are quite a fair deal of links to redirect due to a different URL structure. I plan on doing my redirects as follows: Redirect 301 /old-page/ http://www.newwebsite.com/new-page/
I include that line below the # END WordPress.
So basically there will be roughly 300 lines of Redirect 301 ... in my .htaccess file.
Would this really slow down my site? I have to include all the 300 redirects and I'm using WP.
Thanks
Are you looking to redirect your entire site to a new domain or only migrating from a static site to CMS? What's your current permalink structure? Why are you planning to redirect it, you can customize your permalink structure in wordpress to fit your existing structure.

Resources