Friday, September 5, 2025
HomeLanguagesHow to check if mod_rewrite is enabled in PHP ?

How to check if mod_rewrite is enabled in PHP ?

In PHP, there is an inbuilt function called ‘phpinfo’. By using this function, we can output all the Loaded Modules and see the ‘mod_rewrite’ is enabled or not.

Syntax:

phpinfo();

Here is a process to check the ‘mod_rewrite’ load module is enabled or not.

Note: The local server used here is XAMPP.

  1. Create a ‘check.php’ file in ‘c:/xampp/htdocs’ directory and write the below code in that file and save it.




    <?php
      phpinfo();
    ?>

    
    
  2. Now, start the Apache server from the XAMPP Control Panel.
  3. Open any web browser browser and type following the URL, ‘localhost/check.php’. It will display the PHP version details and Apache Configuration.

  4. In Apache Configuration, search for the Loaded Modules section, and there you will find all the modules that are enabled.
  5. If it is enabled then it will be displayed in the list, as shown in the above screenshot.
RELATED ARTICLES

Most Popular

Dominic
32267 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6635 POSTS0 COMMENTS
Nicole Veronica
11801 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11865 POSTS0 COMMENTS
Shaida Kate Naidoo
6752 POSTS0 COMMENTS
Ted Musemwa
7026 POSTS0 COMMENTS
Thapelo Manthata
6703 POSTS0 COMMENTS
Umr Jansen
6720 POSTS0 COMMENTS