Move/Migrate old site to WordPress on same domain – how to 301 redirect
-
Hi,
I have my old site (it’s not in wordpress) on https://www.mysite.com and now I want to migrate to WordPress (using the same domain). To keep all posts I have for SEO benefits I thought to use a 301 redirect but I’m not sure if this plan works:– I’d like to use one of these plugins Redirection or Simple 301 redirect
– Install WordPress in subdirectory but Display the url of the root with this Giving_WordPress_Its_Own_DirectoryWill it work?
Thanks
-
Hi jumust. I’m not familiar with the redirect plugins myself, but I know my colleagues have tested several of them and they do work.
Is there a specific reason you’re wanting to put wordpress in a sub directory? You should be able to go that route and use .htaccess to only show the main domain (and not the installed sub directory), but that doesn’t sound like the easiest way to go.
Hey Brad,
I want to use the subdirectory only because in the root there are files of old site and I’m worried to mess things up. I should not delete old files, right?With those plugins I should do everything manually, example
Old site : https://www.mysite.com/articles.php?subcategory_id=68
New site : https://www.mysite.com/categoryOr
Old site : https://www.mysite.com/article/35523/postname
New site : https://www.mysite.com/category/postnameWill it work? There is no solution to make things automatically? Is this the cleanest way to not lose all google benefit?
Thanks
There is no solution to make things automatically?
Any of the plugins you listed above look like they will do the job for you, but I don’t believe you’re going to be able to do things automatically. Unless you are familiar with php, it would be quite difficult to automate the redirects.
How many articles would you say you have on your old site? Are we talking tens or hundreds (or more?)
Is this the cleanest way to not lose all google benefit?
Yes, using 301 redirects should be the best route for redirecting old pages to their new pages.
Thanks Brad!
I would say I have hundreds articles….
So what I should do is manually copy in WordPress post and for each of them use 301 redirect destination url, example:Original url : https://www.mysite.com/article/35523/postname
Destination url : https://www.mysite.com/category/postnameSo does it matter if I install wordpress in the root directory where there is already the old site?
So what I should do is manually copy in WordPress post and for each of them use 301 redirect destination url, example:
Yes.
So does it matter if I install wordpress in the root directory where there is already the old site?
You can install WordPress anywhere you’d like, but for setup reasons, putting it in the root directory may be the more easy route.
The problem I see is that you’re going to have is it will be quite tedious to setup 100’s of those 301 redirects.
Yes I know,
it would be quite tedious…
I don’t really know how to start with php to make it automatic, do you know any tutorial where I can get a basic code and then I’ll try to adapt it with the url structure I have in the old site?Thanks
I may be able to help.
What I’ll need is a CSV file listing all of your currently URLs. Then, I would need to know the “/category/” that should show for each url.
jumust – You can do it progamatically via .htaccess and regex if the URLs you’re currently using are in a standard format.
Moving from domain.com/postname to domain.com/postname can be done by just makign sure you use the permalink value of
%postname%
on WordPress, and then editing each post to have the same name.Basically you’ll have to do it manually and that sucks :/
Thanks guys but I need to figure out a bit…
Brad thanks for your help but since it’s something I’m going to do later on next month I’d like to learn so then I can do it by myself, now I can’t give you any CSV…don’t know yet new categories.
I’m trying to see if it’s convenient to migrate to WordPressIpstenu I’m not sure if I catch what you say but sounds like I can do it programmatically via .htaccess and regex.
What I have now in my site is:
Category url: https://www.domain.com/category.php?id=3#
Subcategory url: https://www.domain.com/articles.php?subcategory_id=87
Post url: https://www.domain.com/article/35034
Page url: https://www.domain.com/page.php?id=aboutI think I’ll use in WordPress custom permalinks:
/%category%/%postname%/I’d appreciate any suggestions
Thanks
I tend to do things the hard way. If you created an array of old urls, such as:
https://www.mysite.com/article/35523/postname https://www.mysite.com/article/35524/postname https://www.mysite.com/article/35525/postname
… You could then loop through each link, grab the item after the last / in the url, and then build your new urls. When building the new urls, you would also create 301 redirects that you could place in your .htaccess
Redirect 301 /oldpage.html https://www.yoursite.com/newpage.html
The thing is that you’re going to have 100’s of these 301 redirects in your .htaccess, but I don’t think that’ll be a big problem.
ALSO:
In a previous post, I found out that WordPress has an automated redirect method built in. What I mean by this is that:
If your current URL is:
https://domain.com/category/hello-worldYou could visit any of the following URLS (mis typed urls):
https://domain.com/blah/hello-world
https://domain.com/blah/blah/hello-world… and it would redirect to the correct post:
https://domain.com/category/hello-worldSo, technically, if all of your article titles match up exactly on your old site and new site, you may not need to do anything.
Great I didn’t know about the built in automated redirect method. It should do the job! And without do anything!!! ??
So if I want to develop the new site and start to insert all articles, where do you suggest to install it to keep the actual site working until the switch to WordPress is ready?Should I work on another server and then move everything over to the root of the actual server?
So if I want to develop the new site and start to insert all articles, where do you suggest to install it to keep the actual site working until the switch to WordPress is ready?
It really doesn’t matter where you install it. You could try dev.domain.com or domain.com/wordpress or domain.com/dev. The bottom line is that after you design and build your site, you’ll need to follow the steps to move WordPress to another folder (which really isn’t that hard).
Ok, my concern is:
Let’s say I install in the root, my actual site will be down or there will be any conflict?If not, let’s any both sites will live together in the root. Once I start to insert all articles with the same name of old ones, users who will visit the actual site will be redirected to the development site, right?
How to avoid all this?
You don’t want to install more than one application in the same folder. You can have one website in public_html and one in public_html/wordpress, but you don’t want to have two websites sharing the same parent folder.
What I would do is:
1. Keep your current site live in the root
2. Create your WordPress site in a /dev folder (like domain.com)
3. Once your WordPress site is live and ready to go, remove all the files for your main site and move the files from /dev into the root folder.
4. Test test test!Be sure that throughout this process you have backups of your site. Don’t delete files in mass without having a backup.
You may also want to plan to do this change when traffic to your site is at its lowest, for example late in the evening. In this way, you won’t have many visitors seeing the change (or any errors) as it happens.
Thanks for all your suggestions.
One question:
If I remove all files from the main site, then I’ll lose the old content and how does url redirection work? Users who go to the old url will not be redirected but just will see “Page not found”?Sorry for all questions but really I can’t make mistake on the live site
- The topic ‘Move/Migrate old site to WordPress on same domain – how to 301 redirect’ is closed to new replies.