301 redirect url or htaccess, what is advanced ?

Jovani

Active member
Joined
Jul 10, 2012
Messages
338
Points
28
I do not know a lot htaccess and redirect url (301) with php as;

PHP:
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: http://www.exampledomain.com" );
Is there any difference or advantage between the two for google?
Can I must use htaccess for redirect url?
 

mamet801

New member
Joined
Dec 14, 2012
Messages
1
Points
0
I think htaccesss redirect is better than php redirect :]
cz i've tried to use php redirect it's always shown "page moved here"!! Lol

exit;

PHP:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^oldsite. net$ [OR]
RewriteCond %{HTTP_HOST} ^w**. oldsite. net$
RewriteRule ^(.*)$ h**p://newsite. net/$1 [R=301,L]
 

Irish

New member
Joined
Sep 10, 2012
Messages
101
Points
0
I prefer 301 redirect htacess to PHP redirect. It's simple and easy to apply but in some cases you need to use PHP redirect, it's very efficient.
 
Older threads
Replies
6
Views
5,760
Replies
9
Views
5,084
Replies
16
Views
26,491
Replies
12
Views
10,776
Latest threads
Replies
3
Views
1,483
Replies
2
Views
719
Replies
4
Views
1,813
Replies
2
Views
802
Recommended threads
Replies
10
Views
4,177
Replies
3
Views
1,565
Replies
1
Views
2,920

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top