Thursday, May 23, 2013

How i know, is apache mod_rewrite is enabled

To know about the apache mod_rewrite module is enabled, we can follow two technique. One is using phpinfo other apache_get_modules function.

Let we use phpinfo function first,
  1. Create a file on your localserver root directory and renamed it something like this "phpinfo.php".
  2. then, add this,

    <?php echo phpinfo(); ?>

    and save it.
  3. Then go to your browser and write address like: localhost/phpinfo

    there you see a pic like this




    Look at Loaded Modules and i viewed here only mod_rewrite. Because i already enabled it. If you do not see anything like this, it assume that you have not enable mod_rewrite module.

 The another technique is,
  1. Create a file on your localserver root directory and renamed it something like this "mod.php".
  2. Then add this code snippet,

    <?php
    print_r(apache_get_modules());
    ?>
  3. Then go to your browser and write address like: localhost/phpinfo

    there you see a array like this

    Array (
                        [0] => core
    [1] => mod_log_config
    [2] => mod_logio
    [3] => prefork
    [4] => http_core
    [5] => mod_so
    [6] => mod_alias
    [7] => mod_auth_basic
    [8] => mod_authn_file
    [9] => mod_authz_default
    [10] => mod_authz_groupfile
    [11] => mod_authz_host
    [12] => mod_authz_user
    [13] => mod_autoindex
    [14] => mod_cgi
    [15] => mod_deflate
    [16] => mod_dir
    [17] => mod_env
    [18] => mod_mime
    [19] => mod_negotiation
    [20] => mod_php5
    [21] => mod_reqtimeout
    [22] => mod_rewrite
    [23] => mod_setenvif
    [24] => mod_status
    )
  4. I highlighted the mod_rewrite module. Here it exists because of i have this module already enabled. If you have not this, you need to enable this module.
 

No comments:

Post a Comment