301(?) Redirect

fad3r

Power Member
Joined
Sep 17, 2011
Messages
735
Reaction score
115
Hi,
Does anyone know how to set one of these up? I have a few sites I would like to point to one master site.
 
PHP:
<?php
header("HTTP/1.0 301 bounce");
header("Location: http://domain.com");
header("Connection: close");
?>

or you could do it via .htaccess
 
The following code redirects all pages from Domain A, to corresponding pages on Domain B

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
 
easiest is to fill in this into the .htaccess files:

Code:
redirect 301 / http://www.newdomain.de
 
There is no 'google friendly' method. They all do the same thing.

I like using .htaccess
 
Which one is the most google-friendly, the .htaccess method?


thats what i wondered, the answer is a bit ambiguous isnt it. any goorooos out there who can confirm one way or another or will i have to wade through more andy jenkins written material :eek:
 
can anyone help me? I'm trying to redirect any subdomain to the original domain.

IE:

wtf.domain.com/whatever/ ---> domain.com/whatever/
asdf.domain.com/blah/ ----> domain.com/blah/
etcetc

I've been messing with the .htacces for a while now and can't get it figured out.

tried:
http://www.easymodrewrite.com/example-subdomains
http://stackoverflow.com/questions/...c-from-subdomain-to-domain-without-maintainin
plus about 10 others from stackoverflow

I'm wondering if it's maybe the host I'm using or something (1and1).. they've been known to screw up other things that normally work on other hosts.. so i'm not sure.

placed the .htaccess file in the folder root of the domain.. i know that the .htacess file is working cause i have wordpress setup.. maybe that's interferring? not sure.

here's a sample of the last thing I had tried.

Code:
AddType x-mapp-php5 .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule (.*) http://mydomain.info/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

# END WordPress
 
Back
Top