Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Best way to Redirect a page.

  1. #1
    Join Date
    Mar 2006
    Posts
    600
    Thanks
    5
    Thanked 4 Times in 4 Posts

    Default Best way to Redirect a page.

    What is the best way to redirect a page? Meta refresh, php script, etc?

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Javascript works, but it relies on javascript, obviously, so that's the third best option.

    The meta refresh is a great idea, if you only have access to the source.

    If you have access to how the page is served, as in using PHP, then that's the best option.

    The question is what you have access to for the use of each.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I think .htaccess is another even better way, if available. That may be PHP but, I think it's different.

    http://www.webweaver.nu/html-tips/web-redirection.shtml
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ah, yes, but that's a completely different solution in that .htaccess is a system wide setup, whereas the methods above are individual for each page.

    Using either individually the PHP location header, or widely the .htaccess method would be good, I'd think.

    If these aren't available, then using preferably meta or even javascipt would work too.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Mar 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    to add to djr33's comment

    >If these aren't available, then using preferably meta or even javascipt would work too

    Meta is the best option of the two as it's SEO friendly

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by djr33 View Post
    Ah, yes, but that's a completely different solution in that .htaccess is a system wide setup, whereas the methods above are individual for each page.

    Using either individually the PHP location header, or widely the .htaccess method would be good, I'd think.

    If these aren't available, then using preferably meta or even javascipt would work too.

    Well a .htaccess file may be in a specific directory for only files in that directory. That much I have already come across and used for setting mime types with it. So, if your server supports .htaccess, you should be able to just use a single file in the directory in question with the redirect information for the file(s) in that directory.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    .htaccess seems like extra work as well as being not supported on all servers.
    But if it works, sure.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by djr33 View Post
    .htaccess seems like extra work as well as being not supported on all servers.
    But if it works, sure.
    Not only that but, also it is far superior in many cases as, the redirected page never gets served at all, only the new page.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    PHP location header does the same, though it does send the page to the PHP engine which then sends the browser to the next page. I think.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. #10
    Join Date
    Feb 2007
    Location
    🌎
    Posts
    528
    Thanks
    10
    Thanked 10 Times in 10 Posts
    Blog Entries
    2

    Default

    Use <meta>
    Code:
    <meta http-equiv="refresh" content="1,myPage.htm">
    seconds
    page
    ....(o_ Penguins
    .---/(o_- techno_racing
    +(---//\-' in
    .+(_)--(_)' The McMurdo 500

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
  •