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,297
Replies
9
Views
4,869
Replies
16
Views
26,036
Replies
12
Views
9,779
Latest threads
Replies
0
Views
26
Replies
0
Views
127
Replies
2
Views
330
Recommended threads
Replies
5
Views
3,030
Replies
2
Views
697
Replies
34
Views
21,719
Replies
0
Views
1,906

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