LoginLogin About

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 correctly process 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 an empty directory named mod_rewrite_test/ on the server and upload files .htaccess and index.php into it. The files must have the following contents:
    • .htaccess:

      RewriteEngine On
      RewriteRule ^.*$ index.php
    • index.php:

      <?php
      print 'mod_rewrite works!';
      ?>
  2. Type a URL of the form http://mydomain.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.

Note: Your server must support use of .htaccess files for correct functioning of the mod_rewrite module.