GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Webmaster Q & Fuckin' A (https://gfy.com/forumdisplay.php?f=27)
-   -   301 redirection (https://gfy.com/showthread.php?t=1057294)

jollyhumper 02-12-2012 05:50 AM

301 redirection
 
Hi folks

I discovered that one of my blogs redirects domain.com --> www.domain.com.

I discovered this when a automated search for some links yielded into a
HTTP Error 301 - Moved permanently

None of my other sites have this automated redirection, and I have no clue why this site does.

I've searched a lot now, but the fuck can I find out how to change that.

So, does anyone know how to fix this? I don't want the www.

(Might this fuck up how google searches the site and register backlinks as well?)

Jolly

brentbacardi 02-12-2012 01:11 PM

Look in your .htaccess file

Redirect www to non-www:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

Redirect non-www to www:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]

You should ALWAYS use one of these redirects everytime! This way search engines know which one you want to use and there is no danger in getting duplicate listings/penalties/etc for two different sites with the exact same content.

jollyhumper 02-12-2012 01:48 PM

Thank you very much!

Jolly

jollyhumper 02-12-2012 02:22 PM

However, when I use your code, the browser is sent into a loop, which ends with an error.
(Error is given in Norwegian, but xtremely loosely translated "the command will never be completed")

Jolly

jollyhumper 02-16-2012 08:58 AM

Quote:

Originally Posted by jollyhumper (Post 18754951)
However, when I use your code, the browser is sent into a loop, which ends with an error.
(Error is given in Norwegian, but xtremely loosely translated "the command will never be completed")
Jolly

It does work, the code given. I'm not sure where I fucked up, but when I tried again today, it was effortless. GFmyself

thanks!

Jolly


All times are GMT -7. The time now is 02:58 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123