![]() |
Help with the best redirecting method
Hi folks,
I could bet my question is somewhere answered but the search function is not working. I have a domain.com wordpress blog with a couple of old sub-domains(niches), each one a wordpress blog. It happens that I want to get rid of almost all of those sub-domain blogs, and redirect them to the main blog, and my question is what is the best redirecting method? Thanks |
Quote:
https://wordpress.org/plugins/redirection/ |
I would set up a 301 redirect. It bascially tells the search engines: "this site moved permanently" and is the standard procedure for what you are planning to do.
You can use a WordPress plugin like Grrrrowl suggested or manually edit your .htaccess file. It's usually just a few lines of code. |
Quote:
Quote:
Thanks |
.htaccess for the win.
I have made a htaccess redirect each sub domain by having a htaccess file in each sub domain. |
Quote:
Just a quick example: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^mydomain.com$ [NC] RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301] This code would check that the address the visitor wants to access starts with mydomain.com. If not, let's say because the visitor wants to access mysubdomain.mydomain.com, there will be a 301 redirect to the main domain (mydomain.com). This means no matter which sub-domains the visitor wants to accesss, there will always be a redirect to the main domain. Therefore, it doesn't matter if the sub-domains are active or not. This solution is "quick and dirty" and only makes sense when you don't want to have new sub-domains in the future. |
Actually the htaccess will probably put a greater strain on a busy server because every js, css, gif, jpg etc file will be processed by the htaccess file where as the plugin will probably be a lot more targeted.
If you do go down the htaccess route I would leave the sub-domains up and empty apart from your htaccess but you could put everything on the main site and delete the sub-domains (as per AWB's suggestion above :) ). If you have a dedicated box or a VPS (ie you're not on shared) you have other options such as setiing up redirects in Apache, also I have an idea I did something similar via CPanel and it might be worth looking there too. |
Quote:
|
All times are GMT -7. The time now is 04:36 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc