Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Meta Refresh Redirect


  • Please log in to reply
11 replies to this topic

#1 1dmf

1dmf

    Keep Asking, Keep Questioning, Keep Learning

  • Active Members
  • PipPipPipPipPipPipPip
  • 2,167 posts
  • Location:Worthing - England

Posted 03 April 2009 - 08:55 AM

Hi guys,

I have seen posts saying that if you use an HTTP-REFRESH meta tag and set time to 1 second, this tells the SE's it's a 301 redirect.

Is this true?

I don't see how else you can make an shtml redirect without having access to the server or using mod rewrites?, PERL CGI module redirect doesn't work if run by an SSI command, bit of a pain that one!

Best advice to redirect a specific SHTML is appreciated.

Cheers,
1DMF

#2 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 03 April 2009 - 10:12 AM

QUOTE
I don't see how else you can make an shtml redirect without having access to the server or using mod rewrites?


You'd have to have your host be agreeable to the idea sending the file type (.shtml, .html, .htm, etc) through your server side script processor. Some will, some won't. Most won't IIS hosts won't, sadly.

On the meta refresh question, it sort of depends upon the search engine. It's been awhile since I checked on a test I've had running for years on this subject, however I just looked at it again and nothing appears to have changed.

The short version is that Yahoo! still appears to be the only major search engine that will treat a meta refresh as if it were a proper 301. They're also the only of the majors who have ever told you how they handle them. Yahoo! suggests a short meta refresh redirect (0 or 1 second max) if you want them to treat it as a 301. Anything longer is treated as a 302.

I rather like Yahoo's approach and wish others would follow it. Good on Y! for having a policy and stating it clearly I say.

None of the rest have given such explicit instructions to my knowledge, so you're left to make some assumptions based upon which pages end up showing in their index. But with Google, Ask and MSN/Live even if you have a meta refresh set to 0 seconds or 1 second they still index the original page. Meaning they quite likely treat them like a 302, not a 301.

Bottom line... Meta Refresh simply isn't a reliable substitute for a proper 301.

#3 1dmf

1dmf

    Keep Asking, Keep Questioning, Keep Learning

  • Active Members
  • PipPipPipPipPipPipPip
  • 2,167 posts
  • Location:Worthing - England

Posted 03 April 2009 - 10:33 AM

QUOTE
You'd have to have your host be agreeable to the idea sending the file type (.shtml, .html, .htm, etc) through your server side script processor. Some will, some won't. Most won't IIS hosts won't, sadly.
not sure what you mean Randy. the site runs .shtml through SSI, but i wasn't aware there is an SSI command for performing redirects, is there?

The problem is I replaced the page content with an SSI which executed a PERL script, which simply used the default CGI module and correctly issued a 301 redirect. only it doesn't work like that.

I've found that because the page is a page with SSI inside , the 'header' so to speak has already been created/processed/parsed , what ever the right terminology is, so when the redirect is run in the PERL code it doesn't work as a header has already been displayed to the browser, so in effect you end up with the page not redirecting and when the source is viewed it's a blank page.

If i was to put the url to the redirect perl script direct in my browser address bar , it works correctly, this I don't think can be worked round due to the way an SSI is processed and replied to via the Server/Client.

what would I put in a htaccess file to redirect 301 a page called home.shtml to go to domain route / (basically index.shtml) ?

I think the old mans hosting is *nix, but not 100%, worth a try i guess.

#4 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 03 April 2009 - 10:54 AM

QUOTE
If i was to put the url to the redirect perl script direct in my browser address bar , it works correctly, this I don't think can be worked round due to the way an SSI is processed and replied to via the Server/Client.


Right. Headers have already been sent by the time the cgi via ssi gets called.

QUOTE
not sure what you mean Randy. the site runs .shtml through SSI, but i wasn't aware there is an SSI command for performing redirects, is there?


Not quite what I was after. What I meant is if you can get the server to send .shtml through the asp processor first, then you should be able to trigger a scripted redirect (via asp probably) before headers are sent. I'm assuming here you're dealing with an IIS server since I know that's what your sites run on.

QUOTE
what would I put in a htaccess file to redirect 301 a page called home.shtml to go to domain route / (basically index.shtml)


Is the home.shtml page set up to be the default index page? If it is you'll need to use %{THE_REQUEST} to keep from creating an endless loop. If it's not the following should work in .htaccess

CODE
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/home.shtml
RewriteRule ^(.*)$ /? [R=301,L]


#5 1dmf

1dmf

    Keep Asking, Keep Questioning, Keep Learning

  • Active Members
  • PipPipPipPipPipPipPip
  • 2,167 posts
  • Location:Worthing - England

Posted 03 April 2009 - 11:05 AM

QUOTE
Right. Headers have already been sent by the time the cgi via ssi gets called.
might not have know the correct wording to say that, but I (and you) knew what i meant wink1.gif

I doubt ASP is an option as it's *nix, so i think .htaccess is my only option sad.gif

Edit: nice one randy, basically I was testing and had index.html as 'Underconstruction' , and made home.shtml as the page i was creating the 'homepage' on to test with, now it's time to go live and i've noticed G! has already indexed the darn site (from my site review request on here no doubt) , I know , not complaining, too darn quick though. G! must like HR to index so fast, there is no other way it would have know about the existence of the site.

Anyhow, I just need to get the index.html removed and home.shtml 301 -> domain root.

Your help is much appreciated.

Have a good weekend smile.gif

Edited by 1dmf, 03 April 2009 - 11:10 AM.


#6 Gerry White

Gerry White

    HR 2

  • Active Members
  • PipPip
  • 48 posts
  • Location:UK

Posted 03 April 2009 - 11:32 AM


Yes - I have seen metarefreshes being treated as 301's (in google) , so it will work as a last resort but is something I wpersonally would never reccomend!

trying to think of a solution for the issue your talking about, but the only thing that comes to my mind is a slightly convoluted approach using a 404 page, which has the ability to send a 301 header if the page matches an old page ... its something I TRIED to do once before, but then gave up and went back to just inserting redirects in place...

Good luck ..

G

#7 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 03 April 2009 - 03:58 PM

Yes both Google and Googlebot lurve HRF. lol.gif Remember a week or so back when I posted something (totally non-competitive, but still) about an extension for the Chrome browser to show nofollow links? I'd just put it up earlier that morning when I posted here with a link to it. By that afternoon not only was my little Chrome nofollow page indexed in G, but my little page was also ranking #1. Granted, not a competitive term, but still my personal blog doesn't get spidered nearly that quickly.

That's why we work so hard to get the inevitable spammy schtuff that shows up here at HRF down quickly. It has a lot of lurve to spread around.

On your question....

So home.html is not set up to be the directory index page, right? You shouldn't have to do anything special as long as it's not and a version of the above should work for you. The /? bit in the 2nd part of the RewriteRule should send it to the root domain address. Or you can put the whole domain address in there if you'd like. Either way will work. You may or may not need the Options +FollowSymlinks line. Impossible to say because it depends upon the Apache configuration.

Is that what you're needing? Or does the home.html function as the directory index?

#8 1dmf

1dmf

    Keep Asking, Keep Questioning, Keep Learning

  • Active Members
  • PipPipPipPipPipPipPip
  • 2,167 posts
  • Location:Worthing - England

Posted 03 April 2009 - 04:05 PM

spot on Randy, many thanks .htaccess working like a dream smile.gif

about to GWMT and remove index.html .

side note: perhaps next time i want to index a site I won't bother with GWMT and a sitemap, simple site review request on HRF seems the far more logical option!

#9 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 03 April 2009 - 04:18 PM

QUOTE
about to GWMT and remove index.html


They won't remove it if it doesn't deliver a 404 Not Found status, if memory serves. I believe it does throw an error though.

It should eventually go away on its own as long as you don't link to it as /index.html in your site nav. Just link back to the root domain. If it doesn't go away there are ways to handle it, but I'd let them try first rather than force it down their throat.

Ha! on the side note. Only one review per customer. wink1.gif

#10 1dmf

1dmf

    Keep Asking, Keep Questioning, Keep Learning

  • Active Members
  • PipPipPipPipPipPipPip
  • 2,167 posts
  • Location:Worthing - England

Posted 03 April 2009 - 04:21 PM

QUOTE
Ha! on the side note. Only one review per customer.
am I considered one customer or does my family count separate? wink1.gif

no I've deleted the the straight .html version , so 404 will be found wink1.gif

#11 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 03 April 2009 - 04:40 PM

hysterical.gif

That's like me asking if my multiple personalities each count as a separate customer. giggle.gif

(Just kidding, I don't suffer from that particular affliction. Though I feel like I do some days.)

#12 1dmf

1dmf

    Keep Asking, Keep Questioning, Keep Learning

  • Active Members
  • PipPipPipPipPipPipPip
  • 2,167 posts
  • Location:Worthing - England

Posted 03 April 2009 - 05:02 PM

QUOTE
That's like me asking if my multiple personalities each count as a separate customer.
They do don't they? the clue is in the 'multi-personality' bit! ----- I wouldn't let your alter ego hear you say that hysterical.gif
superman.gif




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

We are now a read-only forum.
 
No new posts or registrations allowed.