JavaScript
  Home arrow JavaScript arrow Page 6 - Server-side redirects: .htaccess versus Me...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Server-side redirects: .htaccess versus Meta Redirects
By: Stephen Davies
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 6
    2007-11-28

    Table of Contents:
  • Server-side redirects: .htaccess versus Meta Redirects
  • How .htaccess can help you: Custom Error Pages
  • Password Protection / Authentication
  • Enabling SSI (Server-Side Includes)
  • Redirects
  • Pros and Cons

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Server-side redirects: .htaccess versus Meta Redirects - Pros and Cons


    (Page 6 of 6 )

    Now that you have looked at the two redirect approaches using server-side .htaccess files and Meta tags, let’s discuss their pros and cons.

    Pros and cons of using the Meta tag redirect:

    Some pros

    • Have control over the redirection without any intervention from the system administrator.

    • You can educate the user about the site change. You can display a change notice to the user and then redirect to the new site.

    Some cons

    • The redirection is only supported by certain browsers such as Internet Explorer, Firefox, and Netscape -- in other words, popular browsers only. If you plan to use a redirection page like this, you should include a link to the site so that users with browsers that do not support the Meta tag redirection can follow the link.

    • The redirection will only work for the specific page that contains the Meta tag. If the user comes into your site looking for multiple pages, you will have to create redirection pages for each of the pages on the site.

    • Some search engines may not recognize the Meta tag redirection.

    Pros and cons of using a .htaccess redirect:

    Some pros

    • The redirection is seamless and causes no disruption to your users.

    • You can apply redirection to one file, one directory and even whole web sites.

    • The redirection is not browser dependent.

    • The redirection can still be recognized by search engines.


    Some cons

    • .htaccess only works in Apache server. That means if your website is hosted by NT server, the .htaccess file will not work.

    • .htaccess will cause server performance issues. For example, if you enabled .htaccess in your website, and a user requests http://www.yoursite.com/album/childhood/single/index.html, since you enabled .htaccess the server will try to locate the .htaccess file in the following paths:

    /.htaccess

    /album/.htaccess

    /album/childhood/.htaccess

    /album/childhood/single/.htaccess


    And so, for each file access out of that directory, there are four additional file system accesses, even if none of those files are present.

    Please note, however, the following security issue. If you enable .htaccess to modify server configuration, this may result in changes over which you have no control. Carefully consider whether you want to give your users this privilege.

    Conclusion

    If you are running sites on Apache server and .htaccess is enabled, .htaccess redirection is better than Meta redirection based on the pros and cons comparison.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · .htaccess redirects seem to cause a huge problem in FF2.0 as the browser downloads...
     

    JAVASCRIPT ARTICLES

    - Validating Digits and Dates with jQuery`s Va...
    - Validating Ranges, Emails, and URLs with jQu...
    - More Uses for the jQuery Tooltip Plug-in`s b...
    - Building Image-Based Tooltips with the jQuer...
    - Using the jQuery Tooltip Plug-in`s bodyHandl...
    - Using Rangelength, Min and Max with the Vali...
    - Using Minlength and Maxlength with the Valid...
    - Modifying Tooltip Coordinates with the jQuer...
    - Applying a Fade Out Effect with the jQuery T...
    - Tracking Mouse Movements with the jQuery Too...
    - Checking Online Forms with the Validator jQu...
    - Nested JavaScript Functions as Objects
    - The jQuery Tooltip Plug-in
    - Active Client Pages at the Server
    - ACP Tab Web Page







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT