301 redirect url or htaccess, what is advanced ?

Jovani

Active member
Joined
Jul 10, 2012
Messages
324
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
4,125
Replies
9
Views
4,239
Replies
16
Views
24,779
Replies
12
Views
7,224
Latest threads
Replies
5
Views
138
Replies
3
Views
97
Replies
6
Views
308
Recommended threads

Referral contests

Referral link for :

Sponsors

Latest Blog ArticlesMost Viewed Threads

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