How to check and enable mod_rewrite module in apache
- Monday, April 7, 2008, 5:42
- how-to, htaccess, tips and technique, tutorial
- 48 comments
Well, I’ve got around 15 emails asking from readers, how to check the mod_rewrite module in apache and enable mod_rewrite module in apache after reading two most of the popular post of this blog 5 useful url rewriting examples and hide .php extension with url rewriting.
How to check weather mod_rewrite module is enabled or not?
Well there are lots of technique to check this but I’ll show you a very simple technique to check weather mod_rewrite module is enabled or not in you web server.
1) Type <?php phpinfo(); ?> in a php file and save it and run that file in the server.
2) And now you can the list of information, just search the word “mod_rewrite” from the browser’s search menu
3) If it is found under the “Loaded Modules” section then this module is already loaded as you see in the picture below, otherwise you need to go to the next step for enabling mod_rewrite module.
How to enable mod_rewrite module in apache in xampp, wamp?
Now, I’ll show you how to enable how to mod_rewrite module in apache installed under windows environment.
1) Find the “httpd.conf” file under the “conf” folder inside the Apache’s installation folder.
2) Find the following line “#LoadModule rewrite_module modules/mod_rewrite.so” in the “httpd.conf” file.You can do this easily by searching the keyword “mod_rewrite” from find menu.
3) Remove the “#” at the starting of the line, “#” represents that line is commented.
4) Now restart the apache server.
5) You can see now “mod_rewrite” in the Loaded Module section while doing “phpinfo()”.
Popularity: 18% [?]
Related Posts
» Hide .php extension with url rewriting using .htaccess
» Get free ebooks of essential PHP and JavaScript tips , tricks & Hacks
» How did I reduce CPU overhead problem caused by MySql?
» How to know and handle disabled javascript in browser
48 Comments on “How to check and enable mod_rewrite module in apache”
Trackbacks
- AJAX coding school » Blog Archive » AJAX Examples [2008-04-07 07:46:31]
- Hide .php extension with url rewriting using .htaccess
- Hide .php extension with url rewriting using .htaccess - Huy’s Blog
- Snygga permalänkar i Wordpress
- URL Rewriting using .htaccess in PHP | php genious
- Hide .php extension with url rewriting using .htaccess « Santanu Bera



THNX, I NEEDED THE STUFF.
Thanks! It worked!
Thank you
Simply Thanks.
Hi,
For security reasons I have to hide the actual names of all the html pages kept in a directory named crop under documentroot directory. I have enabled mod_rewrite module but don’t know how to actually change the url path. please help me out.
the actual url is http://localhost/crop/*.html
* are numerous webpages
how to change these??
i need php script for checking mod_rewrite. thx
Many Thanks.
Really thank you it worked
Thanks very much, however there are other things you can do as well to specify the document root, as some people might have a problem with getting their php applications to work with a specific directory.
changing the parameter in your httpd.conf will help: DocumentRoot: “/var/www/html”
i am really new to apache can you tell me how to do a forwarder on one apache server (server1 primary) to server2 Secondary server.
and can you tell me how to enable .cgi
as i say i am really new to this so the more detail the better for me
thanks for your help
vishuna
i am new in .htaccess, want to know the procedure how to write and execute htaccess file.
i use xamp server in pc.
Thank you so much….it helped me a lot !!!
Thanks for this article.
Good stuff.
Thanks very much.. Its working nice
This is really a great tutorial for mod rewrite. Thanks
Great thanks a lot
explained very simply just like that thanks bro i have searching for this information 2 days now. good job!!!!!!!!!!!
Hi I have tried for rewriting url as in the htaccess file Options +FollowSymLinks
RewriteEngine on
RewriteRule ^ex.html$ example.php. I have created example.php page, when i type in the address bar localhost/directoryname/ex.html, i want to get example.php page but its not working. Please help me… and also i have tried as you have explained above.. Please help me Thanks&Regards Rajeshkumar
thanks lot
Hi
Thanks for the useful information. But I have one question.
First of all I don’t have access for “httpd.conf” so How do I enable “mod_rewrite” module?
please help me.
Regards,
Shree
excellent
thanks a lot
Dear Thanks alot realy….
Hi,
i try to run .htaccess but error is display page is not found.
i have change above and also show mod_rewrite in module loaded box in phpinfo().
but its not working in local pc.
Please help me.
thanks
dvs
Good it really simple and very helpful
Thank-you so much for explaining it in so simple but clear steps.
This is the ONLY decent primer on the basics on enabling mod_rewrite on the web. I know because I have spent half a day looking. Well done.
It has a useful post. Thanks
Thats great , if only everyone could just tell me what I need to do in plain english
Thanks!
AuthType Basic
AuthName “http://localhost/domain/adminpanel”
AuthUserFile http://localhost/domain/adminpanel/.htpasswd
Require valid-user
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([^/]+).html?$ $1.php [L]
i am using this code but i am not get output (php to html extension)
please help me anybody
great post
Thanks for providing such useful information in a simple way.
Thank you very much…..It’s working
Thanks a lot
Thanks for the information but did not help me in hiding php extension of my affiliate redirect php urls. For example my affiliate redirect url for godaddy is http://www.sfihomebizz.com/go/godaddy.php but I want that by just clicking the url http://www.sfihomebizz.com/go/godaddy a user is redirected to my godaddy referral url. What code should I add in .htaccess for this to happen.
Mate! This great tutorial fixed my problem instantly..Thanks…….Matt
how to edit urls…
i m working on this website http://www.googlecricket.com..nd i need ur help.in working with php files
Thanks I am starting and this has definitely helped me.
Information for this blog is very nice thanks for sharing this information keep it up
thank you very mush for this info
Thanks for this cool trick.
Thanks a lot for help and share knowledge with us …