Server-side redirects: .htaccess versus Meta Redirects
URL redirects are needed for a number of reasons. One example is when you have changed significant portions of your website, and then have to deal with the problem of people finding their way from the old pages to the new pages. There are different ways of redirecting pages, through Meta tag http-equiv, JavaScript or any of the server-side languages. And what’s more, you can do it through .htaccess, which is probably the most effective, considering the minimal amount of work required to do it.
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.
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.