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.
Next: Redirects >>
More JavaScript Articles
More By Stephen Davies