GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Help with the best redirecting method (https://gfy.com/showthread.php?t=1160266)

pimpware 02-02-2015 09:16 AM

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

MakeMeGrrrrowl 02-02-2015 09:21 AM

Quote:

Originally Posted by pimpware (Post 20378888)
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

This is the one I use.

https://wordpress.org/plugins/redirection/

Marvin_AWB 02-02-2015 10:31 AM

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.

pimpware 02-02-2015 10:40 AM

Quote:

Originally Posted by MakeMeGrrrrowl (Post 20378896)

MakeMeGrrrrowl thanks for your sugestion, that plugin looks pretty good but at this time I want to keep the plugin numbers at minimum for performance reasons.


Quote:

Originally Posted by Marvin_AWB (Post 20379004)
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.

Setting up a 301 redirect with my .htaccess file would allow me to delete all stuff related with those blogs, even the sub-domains? Or do I have to keep the sub-domains active?

Thanks

suesheboy 02-02-2015 10:45 AM

.htaccess for the win.

I have made a htaccess redirect each sub domain by having a htaccess file in each sub domain.

Marvin_AWB 02-02-2015 11:16 AM

Quote:

Originally Posted by pimpware (Post 20379021)
Setting up a 301 redirect with my .htaccess file would allow me to delete all stuff related with those blogs, even the sub-domains? Or do I have to keep the sub-domains active?

No, you don't have to keep them active.

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.

Paz 02-02-2015 11:17 AM

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.

pimpware 02-02-2015 11:55 AM

Quote:

Originally Posted by Marvin_AWB (Post 20379070)
No, you don't have to keep them active.

Just a quick example:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^mydomain.com$ [NC]
RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301]

This code allow me to add some kind of exception? I want to redirect all but 3 existing sub-domains.


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