PDA

View Full Version : How to check Mod_Rewrite is enabled or not ?



brainpulse
09-15-2010, 02:19 AM
i make .htaccess file but it is not functioning.
So i have one question how i can check at my server Mod_Rewrite is enabled / disabled ?

welcome all suggestion.......

wayne_n_conley
04-05-2018, 02:14 AM
⦁ To check if the mod_rewrite module is enabled, create a new PHP file in the root folder of your WAMP server. Enter the following
phpinfo();
⦁ Access your created file from your browser.
⦁ Ctrl+F to open a search. Search for 'mod_rewrite'. If it is enabled you see it as 'Loaded Modules'
⦁ If not, open httpd.conf (Apache Config file) and look for the following line.
#LoadModule rewrite_module modules/mod_rewrite.so
⦁ Remove the pound ('#') sign at the start and save the this file.
⦁ Restart your apache server.
⦁ Access the same php file in your browser.
⦁ Search for 'mod_rewrite' again. You should be able to find it now.

jesica
01-29-2021, 06:58 AM
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();

hoststud
03-26-2021, 11:19 AM
First thing you have to learn is about mod_rewrite, for that you can check here (https://hoststud.com/resources/what-is-mod_rewrite-and-how-to-setup-mod_rewrite-for-apache.364/)

Best and easy method is to upload phpinfo.php file and add "phpinfo();" function in it.
But there is another method "apache_get_modules" and you can add below code in new created file.
<?php
print_r(apache_get_modules());
?>

But one thing you have to keep in your mind that this module will only work if PHP is running as an Apache module.

jayam
03-27-2021, 03:14 AM
To check if mod_rewrite module is enabled, create a new php file in your root folder of your WAMP server. ...
Access your created file from your browser.
Ctrl F to open a search. ...
If not, open httpd. ...
Remove the pound ('#') sign at the start and save the this file.
Restart your apache server.

jayammrg
03-27-2021, 03:36 AM
Open any web browser browser and type following the URL, 'localhost/check. php'. It will display the PHP version details and Apache Configuration. In Apache Configuration, search for the Loaded Modules section, and there you will find all the modules that are enabled.

chandrao7
03-27-2021, 03:47 AM
Open your website root directory, create a php file mod_rewrite.php: Add the following line of code to it: ? Create . Add the following content to the file: RewriteEngine On RewriteRule ^.*$ mod_rewrite.php. Open your site. Make sure to delete the .

typhil01
04-07-2021, 04:37 AM
Open any web browser browser and type following the URL, 'localhost/check. php'. It will display the PHP version details and Apache Configuration. In Apache Configuration, search for the Loaded Modules section, and there you will find all the modules that are enabled.

Thank you so much for the detailed instructions!

Ryan Cao
08-19-2021, 05:06 AM
I will create a php file with the code "phpinfo();", and then visit this file with browser, and check the loaded Modules section.

typhil01
08-31-2021, 02:43 AM
I will create a php file with the code "phpinfo();", and then visit this file with browser, and check the loaded Modules section.

How do you do the verification?

sahostking
09-01-2021, 11:15 AM
That is how you verify it. When you load the file in your browser you will see the loaded modules section.
This link seems to explain it nicely which I found on google: https://shyammakwana.me/server/2-ways-to-check-for-apache-modules.html

Ostap
09-12-2021, 05:07 PM
You can check from SSH:

apachectl -M | grep rewrite