Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

redirects rank math

how

         

bwnbwn

2:14 am on May 13, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Turning my last website loose.
I am helping new webmaster on this move been my baby 14 years so I want it done right.
Moving to WordPress. he is using rank math so I tested a redirect didn't work he said he would figure it out well hmm so my question.
Would you use your htaccess file or Rank math to do the redirects.
Did a search saw a lot of support tickets with this issue. I have 0 knowledge on this plugin always was webconfig Windows server.
Thanks

not2easy

2:46 am on May 13, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The thing about depending on a plugin for something that you will need 'forever' is that in general, few of them have lasting reliability. I prefer to carefully plot out the site structure (permalinks) to minimize the lines needed for redirects. If the domain name stays the same, that can be as simple as one rule to send requests for https://example.com/page.html to https://example.com/page/.

Is your WP site hosted on a IIS server or Apache - and does the domain name stay the same?

lammert

10:07 am on May 13, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Maybe just let the new webmaster deal with it? If you transfer a property and the new owner decides to rebuild it on WordPress, it is their idea, their problem. There comes a time babies grow up and you don't have to nurture them anymore.

bwnbwn

2:50 pm on May 13, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



noteasy thank you
Right now it's a domain owned by co. behind password login to prevent crawling. When live moving to domain name that is live.
Godaddy hosted Apache. Site is html handcoded not a big site fact maybe 100 redirects. In my searching I see what your talking about WP update redirects quit working.
You pretty much made my mind up.In In my 22 years done millions of redirects but never any using a WP plugin and really only 1 WP site years ago.

Question I looked at the htaccess file on the WP site really nothing in it except index.php but in building site urls change and Rank math creates a redirect in the plugin. So there must be another one I assume not sure.
If I add my redirects in WP file and not through rank math will it work.
Lambert easier said than done

not2easy

4:47 pm on May 13, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I can not in good conscience try to assist with GoDaddy Apache anything, sorry. I know we do not discuss hosts around here, but that's a known, for decades. They just do things differently.

As for WP, there are two places to deal with WP URLs: first in the Admin> Settings panels because WP generates its own URLs based on how it is set up. The settings decide the URL structure, format and syntax. Physical pages do not exist, they are served from the database and syntax depends on the context and settings.

On a normal Apache host you can then add your rewrite rules *outside* of the WP snippet. Do not edit the WP snippet in your htaccess file, as future versions/upgrades can overwrite that WP generated snippet.

WP snippet example:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

That WP generated snippet of code belongs at the end of your rules, after any canonical/https rules.

When you get to actual rewrite rules, it is best to look through the thousands of examples in the Apache [webmasterworld.com] forum where WP rewrite rules abound. I would not suggest relying on a plugin and the current rank math plugin has not been updated for the most recent WP version.

I agree with lammert that figuring out how to manage redirects/rewrites is the buyers issue because any answer that is functional today via plugin will not necessarily continue to function. The Yoast SEO plugin offers a rewrite function but it is not part of their free services and will be an ongoing cost to keep it chugging along. Hence the suggestion for careful planning and setup to be able to use your own 301 redirects.


bwnbwn

5:25 pm on May 13, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



not2easy thank you.
Not selling turning over to my son I'm in hospice now so it's time for me to move own.
I know all about godaddy were he wants to go so end of that story.
Pretty sure I can do the redirects in htaccess file just not sure if there are 2 of them plugin and website. I'll find out gonna test while in current development. Let ya know. Thanks

lammert

6:07 pm on May 13, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In that particular situation I can understand that you want to help with a smooth transition.

Large hosters sometimes have limits on the options that are allowed in the .htaccess file, and as not2easy already mentioned, WordPress upgrades can change the contents of the file without notice. Using a plugin may therefore be the safest bet. The full redirection functionality is not available in the free version of the plugin you mentioned, which might be the reason your first attempts were not working.

not2easy

6:47 pm on May 13, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It makes a big difference, I can understand the extra effort.

If you are unable to view all the files in that /wp-content/plugins/example/ folder to check for another htaccess file, you might be able to zip and download that plugins folder for inspection.

I doubt there is a htaccess in that plugin's location because it would have trouble redirecting incoming requests but it may be stored as a lookup table in the .sql file.

bwnbwn

7:24 am on May 15, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



gonna go with htaccess file because the old site used a subdomain for the mobile. I am a little confused on subdomain urls to domain urls is the below correct.

RewriteCond %{HTTP_HOST} ^m\.example\.com/pages/test.html [NC]
RewriteRule ^(.*) https://www.example.com/contact-us/$1 [L,R=301]

martinibuster

6:24 am on May 17, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



There's a WordPress plugin that is used by over 2 million users called Redirection [wordpress.org] that perhaps you may want to look into, especially if those who are taking over the site aren't handy with hand coding an .htaccess file.

I use it on most of my sites and am very happy with it. It's easy to use and can also alert you to 404 errors, which is handy.

Using a dedicated plugin for redirects will help keep the website independent of RankMath and not locked-in should you use RankMath for redirects but then find you must switch from RankMath to another plugin, this makes it easier to move away from them without having to copy an .htaccess file etc before the move.

The Redirection plugin is a good one, imo. Makes organizing, viewing and creating redirects so easy.

Good luck!
;)

Roger Montti

bwnbwn

3:26 am on May 29, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks for all your help. Had to do redirects in Rank math and htaccess file.
Be surprised how little info there is on subdomain to domain page to page redirects on the web. Very little.
Just finished and proud of sons work on site but he is like most young people do it the easy way. He said. 301 all sub to domain. They don't get it.
Thanks again
Joe

not2easy

1:27 pm on May 29, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I congratulate you for completing the transfer and I'm sure that with more time at the reins he will learn to appreciate the ways you tried to help him have a decent start.
surprised how little info there is on subdomain to domain page to page redirects on the web. Very little.
A site search here for "subdomain to domain redirects" turns up a long page of examples and explanations in the Apache forum, some of the more complete examples:

... do it the easy way. He said. 301 all sub to domain.
It may be a lesson learned the hard way in the end.

bwnbwn

2:52 pm on Jun 11, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just to put a fix here.
There is no way to redirect a subdomain that isn't in a WP environment to begin with. I'm not sure you can if sub was in a WP. Don't know enough to answer that.
Any redirect plugin in WP will not work adding to WP htaccess file above WP code won't work.
To fix it correctly you have to add the subdomain to server and redirect from it.
It's fixed now won't effect website updates etc.
Thanks again
Joe