LoginLogin  Blog About
Search:

Support » Knowledge Base » General questions » Tips for scripts owners »

How can I test mod_rewrite on my server?

Directives of module mod_rewrite are used in WebAsyst to generate SEO friendly URLs of the storefront pages. Note that mod_rewrite can only be used with web server Apache. Follow the instructions below to check whether module mod_rewrite is installed and correctly configured on your server.

  1. Create file .htaccess with the following contents:
    RewriteEngine On
    RewriteRule ^.*$ index.php
  2. Create file index.php with the following contents:
    <?php
    print 'mod_rewrite works!';
    ?>
  3. Create an empty directory on the server, e.g. /mod_rewrite_test, and upload files .htaccess and index.php into it.
  4. Type a URL of kind http://domain.com/mod_rewrite_test/check in your browser address bar.

The page that will open should contain message "mod_rewrite works!". If no such message appears, make sure that the mod_rewrite module is installed and correctly configured and that it is supported by your web server.