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,874
Replies
9
Views
5,139
Replies
16
Views
26,581
Replies
12
Views
10,921
Latest threads
Replies
0
Views
590
Replies
2
Views
789
Recommended 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