guide – Helicon Tech Blog http://www.helicontech.com/articles Web Server Enhancements Wed, 14 May 2014 09:13:21 +0000 en-US hourly 1 https://wordpress.org/?v=5.2.4 Guide: Building FarCry CMS permalinks with Helicon Ape on IIS7 http://www.helicontech.com/articles/farcry-cms-permalinks-with-helicon-ape-on-iis7/ Wed, 12 Aug 2009 10:39:00 +0000 http://localhost:85/blog/?p=48 Continue reading ]]> FarCry CMS is a popular content management solution built with FarCry Core (a web application framework based on the ColdFusion language). As this software is quite popular these days, we want to illustrate to those interested how to operate SEO-friendly URLs in FarCry with the help of Helicon Ape.
Prerequirements: Windows 2008/Vista, IIS7, MySQL, ColdFusion, Helicon Ape.

Step 1. MySQL

After MySQL installation run MySQL Command Line Client and execute the following command:

create database farcrydatabase;

Step 2. ColdFusion

Install Adobe ColdFusion.Make sure ColdFusion is registered in IIS:

  • open IIS Manager
  • open Handler Mappings snap-in
  • check if required handlers were added

Step 3. FarCry CMS

Download the latest version of FarCry CMS.

Unzip the installation package to C:\inetpub\wwwroot\farcry.
Create your project.
Specify project name, project folder and locale.

Select the FarCry CMS Datasource previously created in ColdFusion Administrator area.

Note: create your Datasource in ColdFusion Administrator area as shown below:

Standard FarCry URL looks like: index.cfm?objectid=E689D722-06DF-6D24-56726E44740068B5. Not a friendly URL at all…

After installation login to FarCry Administrator area, choose the Site section and Current Friendly URLs tab in the right side menu.

Click Manage button and add your SEO URL. Set Type of redirection to None and Redirect to to To the default FU because we don’t need a redirect, we only need to show the content of the real page.

We’ve just added friendly URL for our Support page but FarCry CMS says it is still not working.

We can check it by entering our SEO-friendly URL into the browser’s address bar:

Now we’ll eliminate this problem using Helicon APE.Download and install the latest version of Helicon APE.Launch Helicon APE and add these lines to .htaccess file in the root of your site:

RewriteEngine On
RewriteCond %{REQUEST_URI} !(^/farcry|^/webtop|^/flex2gateway|^/flashservices|^/cfide)($|/)
RewriteRule ^([^.]+)$ index.cfm?furl=/$1 [L,NC,QSA]

Save the config.
To make FarCry CMS apply these rules ColdFusion server needs to be restarted. So, go to ColdFusion installation folder (C:\ColdFusion8\) -> /bin/ and launch cfstop.bat file. Then start your ColdFusion server by launching cfstart.bat file.

Now in Administrator area we can see that FarCry CMS has applied SEO-friendly URLs.

Visit your site to make sure that it is really true.

If the result resembles the one above, extend our congratulations – you’ve just set up SEO-friendly URLs for your FarCry site.

Regards,
HeliconTech Team

]]>
Guide: How to enable mod_gzip compression for IIS7 http://www.helicontech.com/articles/how-to-enable-mod_gzip-compression-for-iis7/ http://www.helicontech.com/articles/how-to-enable-mod_gzip-compression-for-iis7/#comments Thu, 12 Mar 2009 15:21:00 +0000 http://localhost:85/blog/?p=32 Continue reading ]]> Hi all! In this article we will tell you how to enable mod_gzip and make it work the way you want. The basics of the module are recounted in Introduction to mod_gzip. We’ll only remind that mod_gzip is used to compress response before it is sent to the client.

Having Helicon Ape installed, open httpd.conf file in Ape installation folder using Helicon Ape Manager. To be able to manage the module you should uncomment corresponding LoadModule directive, as shown on the picture:

IIS possesses its own facilities for GZIP compression. These must be disabled if you are going to use mod_gzip for these purposes. Helicon Ape has a lot more means for more flexible and fine configuring. To disable internal compression in IIS please run IIS Manager, in the tree on the left choose server or specific site. Now open ‘Compression’ element and put the ticks as shown below:


Now we are ready to start writing a simple config. Let’s enable compression for all requests first. According to the docs this may be accomplished in three ways. We’ll use environment variables:

SetEnv gzip

The above line does the following: enables mod_gzip, allows compression for all types of requests, applies default compression level of 6.

Easy, isn’t it? “But where’s the flexibility you promised?” – you wonder. Not all files may be compressed to the same extent. It’s well-known for instance that text documents are more “compressable” than images. And for PNG, JPEG, GIF formats the benefit may tend to zero! And everything would be just great if the module’s operation didn’t take time. So why waste time to fruitlessly compress almost uncompressable files if we can simply say mod_gzip not to touch them. Let’s use mod_setenvif module to disable images compression:

SetEnv gzip
SetEnvIf mime image/.* no-gzip

Much better this time, right? Yeah, better but not the best:) mod_gzip can do even more! Let’s play with compression level now. The default value is 6 but maximum is 9. And sometimes the difference is noticable. As we know the text is compressed well, let’s set it’s compression level to 9, we’ll still ignore images and everything else will be compressed by default:

SetEnv gzip
SetEnvIf mime text/.* gzip=9
SetEnvIf mime image/.* no-gzip

Another situation may be that you want to compress only specific file types. Say you want only HTML/CSS/JS to be compressed with maximum compression level:

SetEnvIf (mime text/.*) and (mime application/x-javascript) gzip=9

Note! If you previously were an Apache fan, the above syntax may surprise you. Yes, it’s true – it’s applicable only in Helicon Ape (for your own good). Here you may find more information on extended syntax.

But if for some reason you want your Helicon Ape config to be compatible with Apache, here the equivalent to what we’ve done before:

mod_gzip_on yes
mod_gzip_compression_level 9
mod_gzip_item_include mime text/.*
mod_gzip_item_include mime application/x-javascript

And the most delicious dish in the end;) We’ve made some kind of compilation of the most effective mod_gzip and mod_cache settings that you may use on your server as is. mod_cache is used to speed up the delivery of compressed content to the user. These two modules working together substantially improve server performance. So here’s the piece that’ll make you happy:

# By file extension
SetEnvIfNoCase request_uri \.mdb$ gzip=9
SetEnvIfNoCase request_uri \.bmp$ gzip cache-enable=mem
SetEnvIfNoCase request_uri \.(?:jpg|gif|png|swf|avi|rm)$ no-gzip                        

# By MIME type
SetEnvIfNoCase mime text/.* gzip=9 cache-enable=mem
SetEnvIfNoCase mime audio/wav gzip cache-enable=mem
SetEnvIfNoCase mime image/bmp gzip cache-enable=mem
SetEnvIfNoCase mime message/rfc822 gzip

SetEnvIfNoCase mime application/msword gzip
SetEnvIfNoCase mime application/postscript gzip
SetEnvIfNoCase mime application/vnd.ms-excel gzip
SetEnvIfNoCase mime application/vnd.ms-powerpoint gzip
SetEnvIfNoCase mime application/vnd.ms-works gzip
SetEnvIfNoCase mime application/x-javascript gzip cache-enable=mem
SetEnvIfNoCase mime application/x-msaccess gzip
SetEnvIfNoCase mime application/pdf gzip

# Exceptions for old browsers
#BrowserMatchNoCase \bOpera(?:\s5\.|/5) and \
#    mime application/.* no-gzip vary-agent !cache-enable
#BrowserMatchNoCase \bMozilla/4\.[67] and \
#    (mime application/.* or mime image/.*) no-gzip vary-agent !cache-enable
#BrowserMatchNoCase \bNetscape(?:6/6\.|/) and \
#    mime application/.* no-gzip vary-agent !cache-enable#BrowserMatchNoCase \bFirefox/1 and \
#    mime application/pdf no-gzip vary-agent !cache-enable

SetEnvIfNoCase (mime text/css) or (mime image/jpeg) vary-agent
BrowserMatchNoCase \bMSIE\s[567]\. and \
    (mime text/css or mime image/jpeg) no-gzip vary-agent !cache-enable

# Vary header should be properly set for cachingHeader merge Vary User-Agent env=vary-agent

# Set expiry delta for static content
# Dynamic pages should set expiry delta by oneself
Header merge Cache-Control max-age=86400 env=cache-enable

You can enable the above preset for your server by uncommenting a single line in httpd.conf:

Include smart_gzip_compression.conf

Conclusion
As you can see, not so many rules are needed to adjust mod_gzip for our needs. We also showed you some examples of Helicon Ape extended syntax, but you may as well use standard Apache-compatible one. We are trying to give you a rich set of instruments, so that you can combine them the way you want and deem necessary. But simplicity and convenience are above all.

Always yours,
HeliconTech Team

]]>
http://www.helicontech.com/articles/how-to-enable-mod_gzip-compression-for-iis7/feed/ 1
Example of mod_cache application http://www.helicontech.com/articles/example-of-mod_cache-application/ Wed, 21 Jan 2009 15:23:00 +0000 http://localhost:85/blog/?p=22 Continue reading ]]> In the previous articles we told you what cache is and how it works in Helicon Ape. Now it’s time to use obtained knowledge in practice. Today we gonna apply caching for PHP application called qdig that helps organize images web-gallery. Read how to register PHP on IIS7 in our article about WordPress.

Creating online photo album

Let’s create photos folder in site root and fill it with our photos. Now we are downloading qdig. To make it simpler we’ll extract only one index.php file and put it into the same directory.

The gallery is already working: http://localhost/photos/index.php

Measuring performance

To measure request rate we’ll use ab.exe application:

ab.exe -n 200 -c 2 "http://localhost/photos/index.php?Qwd=.&Qif=DSC00410.JPG&Qiv=name&Qis=M"

The result is a bit more than 16 requests per second.

Switching on mod_cache and mod_expires

To enable necessary modules, let’s uncomment the following lines in Helicon Ape httpd.conf file:

LoadModule expires_module    modules/mod_expires.so
LoadModule cache_module      modules/mod_cache.so

Analyzing cached request

To make mod_cache cache not all requests but only unique ones, let’s figure out what qdig request parameters mean and how request uniqueness depends on them:

  • Qwd – folder where image files reside – AFFECTS request uniqueness;
  • Qif – file name – AFFECTS request uniqueness;
  • Qiv – mode of file names representation – AFFECTS request uniqueness;
  • Qis – image size – DOESN’T AFFECT request uniqueness;
  • Qtmp – representation mode – DOESN’T AFFECT request uniqueness;

Thus, cache key will use only Qwd, Qif and Qiv parameters.
The piece of config for mod_cache will look like:

<Files index.php>
  CacheEnable mem
  CacheVaryByParams Qwd Qif Qiv
</Files>

Expiration time

index.php script does not set Cache-Control and Expires headers, but, as we already know, they are really important for successful caching. So we’ll set these headers by ourselves. And for that purpose we’ll use mod_expires functionality:

ExpiresActive On
ExpiresByType text/html "access 1 hour"

Above directives set expiration time to 1 hour.
The resulting .htaccess is as follows:

Measuring performance once again

ab.exe -n 200 -c 2 "http://localhost/photos/index.php?Qwd=.&Qif=DSC00410.JPG&Qiv=name&Qis=M"

And now the result is about 94 requests per second!

That’s all you need to do to achieve sixfold performance growth.
This example clearly demonstrates the ease and efficiency of Helicon Ape caching feature.

]]>
How mod_cache works? http://www.helicontech.com/articles/how-mod_cache-works/ http://www.helicontech.com/articles/how-mod_cache-works/#comments Mon, 12 Jan 2009 16:12:00 +0000 http://localhost:85/blog/?p=19 Continue reading ]]> Helicon Ape release (coming very-very soon) will contain mod_cache module. And as we promised in our previous article we are now giving you more thorough description of mod_cache operation.

mod_cache starts working

After authentication/authorization events but prior to request handler execution mod_cache comes out on the scene.At this stage the module performs the following:

  • checks whether it’s possible to use cached response for the current request
  • if yes, generates a key and searches cached response using this key
  • if the response is found in cache, the module gives it back to the client and request processing is over — request handler is not invoked.

Cacheable or not cacheable: request check

Response may be cached if request meets the following requirements:

  • request method is GET
  • request does not contain Authorization header
  • Cache-Control request header must not be no-cache. This condition is ignored if CacheIgnoreCacheControl On is used
  • Pragma request header must not be no-cache. This condition is ignored if CacheIgnoreCacheControl On is used

mod_cache attempts to save response

When request handler has completed its job and all defined filters have been applied to response, mod_cache starts to operate. At this stage the module performs the following:

  • estimates the capability of response caching
  • checks if CacheEnable is set for this request
  • generates cache key
  • defines the period of time to store response in cache (absolute expiration time)
  • saves response in cache according to the key

Cacheable or not cacheable: response check

The following conditions are considered when deciding whether response is cacheable (all must be met at a time):

  • request method is GET
  • response status is 200 (200, 203, 300, 301 or 410 in Apache)
  • Expires response header contains valid “future” date
  • responses containing expiration time (i.e. Expires or Cache-Control: max-age=XX headers), Etag header or Last-Modified header. This condition is ignored if CacheIgnoreNoLastMod is used
    • if request has a QueryString, only those responses containing expiration time are cached (i.e. Expires or Cache-Control: max-age=XX headers). This condition is ignored if CacheIgnoreQueryString On is used
  • Cache-Control request header must not be no-cache. This condition is ignored if CacheStoreNoStore On is used
  • Cache-Control request header must not be private. This condition is ignored if CacheStorePrivate On is used
  • request does not contain Authorization header (for Apache: if Cache-Control contains s-maxage, must-revalidate or public)
  • Vary response header does not contain “*”.

Cache key generation

Response is saved in cache according to the key. This key includes:

  • normalized (canonical) request URI without QueryString or, in case of proxy request, normalized proxy request URL;
  • all QueryString parameters and their values in alphabetical order (default behavior)
    • CacheIgnoreQueryString On directive cancels addition of request parameters to the cache key
    • CacheVaryByParams param1 param2 ... directive defines parameters to be included into cache key
  • all request headers specified in CacheVaryByHeaders header1 header2 ... directive. Headers are not included to the cache key by default.
  • If response contains Vary header, all request headers specified in it are included into cache key.

When cached response dies

HTTP response is stored in cache for a specific period of time that is computed in the following way:

  • If response contains Expires header and its value is valid and does not refer to the past, cached response will be stored till the time specified in it.
  • If response contains Cache-Control header with either max-age=X or s-maxage=X, cached response will be stored in cache for X seconds.
  • If response contains Last-Modified header, cached response will be stored in cache until:expiry date = date + min((date – lastmod) * factor, maxexpire),where date – current date,lastmod – value of Last-Modified header,factor – float value set via CacheLastModifiedFactor directive (default value = 0,1),maxexpire – value set via CacheMaxExpire directive (default value = 86400 seconds = 1 day).
  • If mod_cache was unable to calculate expiration date using one of aforementioned methods (this is possible if response doesn’t have Expires, Cache-Control, Last-Modified headers BUT has Etag header), it (date) is equated to default value of 1 hour that may be reset using CacheDefaultExpire directive.

This load of text might look a little unclear for you at a glance, but in reality this is a well-composed and highly efficient scheme. And our upcoming article will convince you in this.

]]>
http://www.helicontech.com/articles/how-mod_cache-works/feed/ 34
Tuning WordPress with Helicon Ape on IIS7 (permalinks, browser/server caching, compression) http://www.helicontech.com/articles/tuning-wordpress-with-helicon-ape-on-iis7-permalinks-browserserver-caching-compression/ http://www.helicontech.com/articles/tuning-wordpress-with-helicon-ape-on-iis7-permalinks-browserserver-caching-compression/#comments Wed, 24 Dec 2008 11:54:00 +0000 http://localhost:85/blog/?p=17 Continue reading ]]> WordPress is a highly popular and rapidly growing open source CMS providing powerful blog-designing facilities. Accounting for its popularity we decided to write an article in which we’ll show how to optimize, speed up, prettify WordPress operation using Helicon Ape. So, let’s start.
Prerequirements: Windows 2008/Vista, IIS7, FastCGI, Helicon Ape

Step 1. MySQL

After MySQL installation run MySQL Command Line Client and execute the following command:

create database wordpress;

Step 2. PHP

Install PHP into C:\inetpub\php to inherit NTFS permissions of IIS directory. It is of importance that C:\inetpub\php\php.ini contained the following directives:

magic_quotes_runtime = Off
extension_dir = "C:\inetpub\php\ext\"
extension=php_mysql.dll

After ensuring the directives are in place you need to register PHP in IIS configuration. To accomplish this:

  • open IIS Manager
  • open Handler Mappings snap-in

  • press ‘Add Module Mapping’ and fill the fields in the opened window in accordance with the next screenshot (all images are clickable)

 

Step 3. WordPress

Download the latest WordPress version

Unzip the package into C:\inetpub\wwwroot\wordpress

Rename wp-config-sample.php into wp-config.php.

Adjust MySQL connection:

Create a blog

Now in Administrative panel you can set SEO-friendly format for your links, e.g: /%post_id%/%postname%

Your links will now look like http://localhost/wordpress/2008/uncategorized/hello-world

instead of http://localhost/wordpress/?p=123. If you now attempt to access any of the pages on your blog,

you’ll get 404 Not Found error

And that is defenitely not the desired result!

Step 4. Helicon Ape

It’s time to fix the above inconveniences and accelerate WordPress.

We’ll use the following Helicon Ape modules:

4.1 mod_rewrite

It’ll assist us in handling SEO-friendly URLs.

Open Helicon Ape Manager and uncomment/add the following line in httpd.conf to enable mod_rewrite:

LoadModule rewrite_module  modules/mod_rewrite.so

Now in Helicon Ape Manager browse to WordPress folder and put the following code to .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?$1 [L,QSA]

This piece of code checks whether the requested resource is physically located on the disk and if it doesn’t, performs rewriting to index.php.

Save changes to .htaccess. Request any blog page once again… It works!

Yes, it does… but not the best way… So we are moving on! ‘Cause only the best is good enough:)

4.2 mod_expires: client/proxy content expiration

With this module we’ll adjust browser cache so that the browser doesn’t send excess requests to the server. Go back to httpd.conf in Helicon Ape Manager and uncomment/add the following line:

LoadModule expires_module  modules/mod_expires.so

Subsequent lines (being put to .htaccess) will tell browser cache that images, css and JavaScripts must not be requested from the server (but rather taken from cache) within 1 day after retrieving resource for the first time:

ExpiresActive On
ExpiresByType image/jpeg "access plus 1 days"
ExpiresByType image/gif "access plus 1 days"
ExpiresByType text/css   "access plus 1 days"
ExpiresByType application/x-javascript  "access plus 1 days"

Let’s check what’s changed. The first request grabs all page resources and for each image, css and JavaScript sets the header Cache-Control: max-age=86400

Upon consequent requests to that page the browser does not ask for images, css and JavaScripts from the server but takes them from the cache until max-age expires.

4.3 mod_gzip

Are you enjoying the process? Then let’s implement the next stage. To make things even better, let’s apply on-the-fly compression that will reduce traffic and speed up page load. In our irreplaceable Helicon Ape Manager please uncomment/add the following line inside httpd.conf:

LoadModule gzip_module  modules/mod_gzip.so

And put the following lines into .htaccess in WordPress folder:

mod_gzip_on yes
mod_gzip_item_include Mime ^text/.*

These directives instruct Helicon Ape to compress only those resources which type starts with “text/”, i.e. all text, .html and .css files. Usually images and video compression is useless.

Uncompressed page had Content-Length: 5152, the same page after compression became as small as Content-Length: 2168. So, we’ve managed to reduce the amount of info to be transferred almost twice.

4.4 mod_cache

We are coming to the final and in conclusion we’ll enable server-side caching. Instead of requesting the same page from the server again and again Helicon Ape saves the copy of server response and fires with it when corresponding page is needed.

Uncomment/add the following line in httpd.conf (using Helicon Ape Manager):

LoadModule cache_module  modules/mod_cache.so

We’ll only cache index.php page. It will be stored in cache for 30 seconds so that the site looked dynamic. There’s no need to cache static files (.html, .css, images, Flash, videos) because IIS processes them really fast.

Note! It is worth mentioning that cache distinguishes query string parameters, thus it will store different snapshots for different blog pages.

There are some shortcomings of this type of caching (semi-dynamic web application). E.g. if the user posts a comment on the blog, it will see the result (his post) immediately, but another user browsing this page will only see it in 30 seconds (after cache expires). This issue may be resolved by reducing the time snapshot lives in cache, but it should nevertheless be taken into account.

Put the following lines into .htaccess in WordPress folder:

<Files index.php>
ExpiresByType "text/html; charset=UTF-8" A30
CacheEnable mem 
CacheVaryByHeaders Original-Url 
</Files>

Let us compare the productivity with and without cache. On our testing virtual machine we’ve obtained the following values:

  • without cache – 7.45 requests per second
  • with cache – 711 requests per second!

 

4.5 mod_headers

The last drop we want to add to our WordPress-based dish will hide IIS from robots and scanners.

You need to uncomment/add the following line in httpd.conf:

LoadModule headers_module  modules/mod_headers.so

And put the only line into .htaccess:

Header set Server "Apache/2.2.9 (Unix)"

Now our IIS appears to the world like

Congratulations to everyone who came to finish! It’s all done now! Enjoy flawless and fast WordPress operation and stay with us!

Best regards,

Helicon Team.

]]>
http://www.helicontech.com/articles/tuning-wordpress-with-helicon-ape-on-iis7-permalinks-browserserver-caching-compression/feed/ 9
URL-rewriting basics and map-files application http://www.helicontech.com/articles/url-rewriting-basics-and-map-files-application/ http://www.helicontech.com/articles/url-rewriting-basics-and-map-files-application/#comments Fri, 19 Dec 2008 13:43:00 +0000 http://localhost:85/blog/?p=15 Continue reading ]]> Lack of understanding of basic URL-rewriting concepts often leads to the problems with rules-writing. So we decided to give a brief and simple explanation of some general concepts.

URL-rewriting allows to substitute real (often ugly) URLs with pretty ones and expose them to users as well as to search engines. The idea is that the user requests for example http://www.site.com/pretty_file.htm (this link is indexed by search engines) and in reality browser shows the content of say http://www.site.com/index.aspx?id=123 (that is real physical file on your server).

Regular expressions empower you to create more complex and efficient rules and add conditions to gain better flexibility and performance.

There are several ways of writing rules; the choice depends on a specific situation.For example if you have these pages:

Real URLs            Rewritten (pretty) URLS
/index.php?q=444 => /page.html
/index.php?q=345 => /another-page.html
/index.php?q=999 => /about.html

You may EITHER use the following rules to implement rewriting functionality:

RewriteRule ^/page\.html$         /index.php?q=444 [NC,L]
RewriteRule ^/another-page\.html$ /index.php?q=345 [NC,L]
RewriteRule ^/about\.html$        /index.php?q=999 [NC,L]

OR

you may use map-files (which are preferable in this case):

Info: Map-file is a .txt file containing pairs of values written in two columns (as shown below). The first (left) column represents the value to which RewriteRule matching result will be compared, and the corresponding value in right column represents the result that will be placed into the substitution URL.

In our example we’ll create a text document (e.g. map.txt) in the folder with .htaccess and put in the following:

page           444
another-page   345
about          999

And our configuration file (.htaccess) will have the following look:

# Set a variable ("map") to access map.txt from config
RewriteMap map txt:map.txt

# Use tolower function to convert string to lowercase
RewriteMap lower int:tolower

# Get requested file name
RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC]

# Seek file name in map-file
RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND

# Perform rewriting if the record was found in map-file
RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L]

Helicon Ape Manager

Note! Map files are case-SENSITIVE. So, “Page” will not match “page”. That is why it is advisable to use tolower function that converts matched part to lowercase before comparing it with map-file entries. Don’t forget that in this case all map-file records should also be lowercase.

Map-files are particularly advantageous when you have to rewrite loads of URLs of the similar pattern. The first benefit is that map-file may have virtually unlimited size (up to several gigabytes); secondly, parsing of a large map-file is much faster than processing of a huge .htaccess (or httpd.conf). We don’t recommend using configuration files with more than 100-150 rules.

Hope this info made in easier for you to grasp the idea of URL-rewriting.

Looking forward to your comments and suggestions.

Sincerely Yours,

HeliconTech Team.

]]>
http://www.helicontech.com/articles/url-rewriting-basics-and-map-files-application/feed/ 3
How to enable mod_rewrite in Helicon Ape http://www.helicontech.com/articles/how-to-enable-mod_rewrite-in-helicon-ape/ Thu, 18 Dec 2008 14:42:00 +0000 http://localhost:85/blog/?p=14 Continue reading ]]> Hope you’ve already installed Helicon Ape and are ready to have a look at it. So, let’s start!

Run Helicon Ape Manager from Start – Programs – Helicon – Helicon Ape – Helicon Ape Manager.

To enable mod_rewrite in Helicon Ape you should simply add/uncomment the following derective in httpd.conf:

LoadModule rewrite_module  modules/mod_rewrite.so

Helicon Ape Manager

1. The easiest way to check if mod_rewrite is working correctly

Now to make sure mod_rewrite operates correctly add the following code into .htaccess in the root of your site:

RewriteRule . – [F]

Note! Don’t use this directive on live server!

Helicon Ape Manager

Now save changes to .htaccess

Helicon Ape Manager

Make any request to your site. If mod_rewrite works fine, the result will be 403 Forbidden, otherwise you’ll get 404 Page not found.

Hurrah! It works! Now let’s move on to the real example.

2. Example of basic rewrite rule

Let’s create a file, say test.asp, in the root of your site. And put the following code that will show us current date/time

Done? Then put the following rules into the .htaccess in the root of your site

RewriteEngine On
RewriteBase /
RewriteRule ^foo\.htm$ test.asp [NC,L]

Save .htaccess.

If you now request http://localhost/foo.htm, you’ll get the content of http://localhost/test.asp.

May your first steps with Helicon Ape be firm and sensible.

Sincerely Yours,
Helicon Team.

]]>