![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jan 2006
Location: Pt
Posts: 1,673
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 | |
Grrrrrrrrr
Industry Role:
Join Date: Oct 2002
Location: Dreamland
Posts: 4,974
|
Quote:
https://wordpress.org/plugins/redirection/ |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Registered User
Industry Role:
Join Date: Dec 2014
Posts: 62
|
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.
__________________
► AdultWebmasterBlog.com - Tips, tricks and tutorials for adult webmasters. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | ||
Confirmed User
Join Date: Jan 2006
Location: Pt
Posts: 1,673
|
Quote:
Quote:
Thanks |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Nov 2002
Location: FL - TN/NC
Posts: 5,211
|
.htaccess for the win.
I have made a htaccess redirect each sub domain by having a htaccess file in each sub domain. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Registered User
Industry Role:
Join Date: Dec 2014
Posts: 62
|
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.
__________________
► AdultWebmasterBlog.com - Tips, tricks and tutorials for adult webmasters. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Jun 2012
Posts: 457
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Jan 2006
Location: Pt
Posts: 1,673
|
This code allow me to add some kind of exception? I want to redirect all but 3 existing sub-domains.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() ![]() |
|||||||
|
|||||||
Bookmarks |
Tags |
blog, question, wordpress, method, redirecting, rid, main, redirect, sub-domain, blogs, search, function, answered, folks, sub-domainsniches, bet, couple, domain.com |
Thread Tools | |