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
6,251
Replies
9
Views
5,379
Replies
16
Views
27,022
Replies
12
Views
11,287
Recommended threads
Replies
9
Views
6,020
Replies
5
Views
5,083
Replies
36
Views
24,293
Replies
9
Views
9,333
Replies
3
Views
5,176

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