Welcome to WebmasterWorld Guest from 54.162.240.235

Message Too Old, No Replies

Can I use Url Redirect Code in the head of the page

     
9:19 am on Aug 28, 2013 (gmt 0)

5+ Year Member



Hi All,

Can i use Url Redirect Code in header of each pages for which i want to re-direct (old page to new page)?

Or i need to place in .htaccess file

Suggest me.
9:57 am on Aug 28, 2013 (gmt 0)

WebmasterWorld Administrator 5+ Year Member Top Contributors Of The Month



I presume you are refering to meta refresh with zero seconds that you would put in the <head> section of each page, which would then cause browser to redirect the user to a target URL.

It is recommended that you use .htaccess It may also be less work using .htaccess as you may achieve redirects for multiple pages on your site with a few well constructed rules. Using .htaccess will also be faster.

It was said that Google treats meta refresh with zero seconds as 301 redirect. I do not have experience of a site that uses meta refresh extensively to redirect many page, but the idea makes me uneasy. Using meta refresh should be your last resort, if you do not have the access to your .htaccess file.

Interestingly, I have seen recently browser redirecting based on meta refresh even when the line is not put in the <head> section of html, but was in <body> instead.
10:09 am on Aug 28, 2013 (gmt 0)

5+ Year Member



Thanks for reply. I am not using or talking about meta refresh tag, its a PHP 301 Redirect code which help us to redirecting old page to new page.

So, is PHP 301 Redirect code is seo friendly?
10:24 am on Aug 28, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Is the 301 issued before the page is built, so the user (human or robot) never loads the originally requested page at all? If so, the search engine has no way of knowing where the redirect came from.

But in general, if the redirect can be done in htaccess rather than in an individual page, use htaccess. Keep all the redirects in one place, and consolidate them so you never get multi-redirect chains. (Never mind the search engines: multiple redirects are bad for users with slow connections.)
10:52 am on Aug 28, 2013 (gmt 0)

10+ Year Member



Yes, you can. There won't be any difference between .htaccess redirect and php redirect.
10:56 am on Aug 28, 2013 (gmt 0)

5+ Year Member



Is there any limit ?
11:12 am on Aug 28, 2013 (gmt 0)

WebmasterWorld Administrator 5+ Year Member Top Contributors Of The Month



So, is PHP 301 Redirect code is seo friendly?

Sorry, I have misunderstood what you asked.

There is absolutely no issue with generating 301 via PHP. There is no limit on how many pages either.

The client will not know any difference. So if this is your preferred choice, go ahead with no fear.
11:13 am on Aug 28, 2013 (gmt 0)

5+ Year Member



why i have implemented the 301 redirection because my website was hacked and all product pages are used to be in dynamic format like this /Products.php?id=11

And i have resolved the hacking issue and implemented 301 re-directions for all major 80 pages and after few months i got the below message in GWT

Subject: Big traffic change for top URL

==================================

"The number of clicks that your site receives from Google can change from day to day for a variety of factors, including automatic algorithm updates. However, if you have recently made significant changes to the content or configuration of your site, this change may be an indication that there are problems."

=================================

Now What to do ? How to bring my traffic back?
11:38 am on Aug 28, 2013 (gmt 0)

WebmasterWorld Administrator 5+ Year Member Top Contributors Of The Month



If I understood well, you have created new URLs for these 80 products and redirected page-to-page from old URLs to new URLs.

Do new URLs now rank in place of old URLs ?

With regards to the above message in WMT, I get them periodically for pages that are of seasonal nature and therefore there are periods of sharp increase in CTR, as well as drop of CTR thereafter. In both cases I get this message in WMT.

What I would be looking also is the impressions figure combined with "average position" (however unreliable it is). If the impressions died and your average position dropped, it may be that the interest in subject remained the same, but you are not ranking well enough any more.

Now What to do ? How to bring my traffic back?

I would firstly do the analysis to see:
- are my "new" URLs (URLs to which the old redirect to) rank as well as the old URLs did
- if not, verify that there is no tecnical problem with execution of 301 redirect
- see if you can isolate which URL has traffic drop or is it across the board
- see if you can isolate which keywords have you "lost" (to a degree at least, because "not provided" will not allow for a complete picture)
1:49 pm on Aug 28, 2013 (gmt 0)

WebmasterWorld Senior Member planet13 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



I once redirected my most popular page via a 301 redirect to a new page.

Once google indexed the new page, I got that same message: that my most popular page had seen a big decrease in traffic.

Of course, it was because all the old traffic was now going to the new page, which had been properly redirected.

So do what aakk9999 suggests:


- are my "new" URLs (URLs to which the old redirect to) rank as well as the old URLs did
- if not, verify that there is no tecnical problem with execution of 301 redirect
- see if you can isolate which URL has traffic drop or is it across the board
- see if you can isolate which keywords have you "lost" (to a degree at least, because "not provided" will not allow for a complete picture)
4:17 am on Aug 29, 2013 (gmt 0)

5+ Year Member



Hi aakk9999,

-No, new urls are not ranking as old urls used to rank.
- Crosschecked and verified, no technical problem with execution of 301 redirect
- All new urls which are redirected page-to-page from old URLs to new URLs as loss there keyword positions
- minus 50 degree found and all new pages (keywords) are ranking to irreverent pages like guides..
4:26 am on Aug 29, 2013 (gmt 0)



Yes, you can
you also can use .htaccess redirect or php redirect.
4:36 am on Aug 29, 2013 (gmt 0)

WebmasterWorld Senior Member Top Contributors Of The Month



So, is PHP 301 Redirect code is seo friendly?

As people have said previously, absolutely!

I run most redirects and rewrites through PHP on more than one site and there's no noticeable difference I've found, so if you prefer to use PHP rather than .htaccess, my opinion is, and my experience tells me, you should: Go Ahead!
8:58 am on Aug 29, 2013 (gmt 0)

WebmasterWorld Administrator 5+ Year Member Top Contributors Of The Month



This could mean that your site is still affected by past hack you had.

Did your original (old) URLs dropped as a result of hack? I am curious why did you create new URLs and redirected once you fixed hacking issue? Is it because you have moved to new URL structure which does not have querry string (SEF URLs)?
10:37 am on Aug 29, 2013 (gmt 0)

5+ Year Member



Hi aakk9999,

Did your original (old) URLs dropped as a result of hack?


- After getting hacking issue we have created the new pages.

I am curious why did you create new URLs and redirected once you fixed hacking issue?


- After getting hacking issue, we have created the new urls to avoid sql injections.

Is it because you have moved to new URL structure which does not have querry string (SEF URLs)?


- yes and to avoid sql injections and query string in url(SEF URLs).
 

Featured Threads

Hot Threads This Week

Hot Threads This Month