SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot strangealienmagic's Avatar
    Join Date
    May 2001
    Location
    Metro Detroit area, Michigan
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Noscript redirect possible w/o using meta refresh?

    I'm wondering if there is a way to redirect someone with their browser's Javascript/scripting turned off, to another page automatically, using something other than meta refresh between the noscript tags. My reasoning is that using meta refresh (even between noscript tags) might not go over well with search engines who aparently view any refresh time under 10 seconds as being spam.

    I've looked, but haven't found any other solution.

    I'm not a programmer by any stretch of the imagination, but I thought server-side scripts work even when a browser's Javascript is turned off.

    So... is it possible to do with PHP or Pearl, and can you give me an idea of how?

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2000
    Location
    Palo Alto, CA
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    yep

    add header to server response:

    Location: http://newsite/some.html

  3. #3
    SitePoint Zealot strangealienmagic's Avatar
    Join Date
    May 2001
    Location
    Metro Detroit area, Michigan
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Java, I appreciate knowing it can be done, but I wasn't kidding about not being a programmer...

    Can you elaborate a bit? My site is virtually hosted - don't know if that makes a difference - not on a dedicated server. Is adding that to the header done with with an .htaccess file? something like redirecting a 404 to a custom404 page? Kinda lost here.

    Thanks!

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2000
    Location
    Palo Alto, CA
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, in perl you have
    Code:
    #!/usr/bin/perl -w
    Now all you need is to add server response as:
    Code:
    print "Location: http://your.url/file.html\n\n";
    And whole thing:

    Code:
    #!/usr/bin/perl -w
    print "Location: http://new.url/file.html\n\n";
    save it as anyname.pl, put it in 'cgi-bin' (Usually cgi-bin but ask admin
    if where you can place perl files to be parsed by the server, if you dont have cgi-bin dir)

    chmod it as
    Code:
    chmod +x anyname.pl
    now load it in browser, and it will redirect you to new page, but will leave same URL
    in your browser.
    Hope that helps.

  5. #5
    SitePoint Zealot strangealienmagic's Avatar
    Join Date
    May 2001
    Location
    Metro Detroit area, Michigan
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the clear details!

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2000
    Location
    Palo Alto, CA
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    glad to be helpfull.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •