JavaScript
  Home arrow JavaScript arrow Page 4 - 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 - Enabling SSI (Server-Side Includes)


    (Page 4 of 6 )

    How many pages do you have in your website? Maybe a few dozen, right? And every page has the same header, navigation menu, footer and copyright information. What will you do if you want to add a menu item? It’s a nightmare for you, right? If you use SSI, you just make the modification once and all pages will be changed. Does that sound useful?

    Okay, let’s do it.

    AddType text/html .shtml

    AddHandler server-parsed .shtml

    The above directives indicate that files with the .shtml extension are the text/html type and will be parsed by the server.

    For example you have a page in your products - products.shtml:

    <html>

    <head>

    ..

    </head>

    <body>

    <!--#include virtual=”include/header.html”-->

    .

    <!--#include virtual=”include/menu.html”-->

    <!--#include virtual=”include/footer.html”-->

    </body>

    </html>

    Blocking, Changing and Redirects

    When you find somebody whom wants to hack your site, that’s okay, just block his IP or an IP range.

    order deny, allow

    deny from 10.133.11.110

    deny from 10.188.

    allow from all

    The above snippet directive will block requests from IP 10.133.11.110 and an IP address that begins with 10.188.

    Consider that you are using a JSP script to create your dynamic website, and will be adding index.jsp to the default directory welcome page.

    DirectoryIndex index.htm index.html index.shtml index.jsp default.cgi

    By configuring the above directive in your .htaccess file, when a request comes to a directory, the server will attempt to locate the files from left to right as the default directory page.

    More JavaScript Articles
    More By Stephen Davies


       · .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 1 Hosted by Hostway
    Stay green...Green IT