Today I will show you how to enable mod_rewrite in xampp. This is useful when we have to rewrite the URL. generally for SEO purpose, we want SEO friendly URL. Converting the normal URL to SEO friendly URL will need to enable mod_rewrite.
Steps to Enable mod_rewrite in xampp
- Go to the directory where xampp is installed
C:\xampp\apache\conf
. - Open and edit httpd.conf in a text editor
- find this line in httpd.conf file.
1#LoadModule rewrite_module modules/mod_rewrite.so - After finding this line, replace this line by this text.
1LoadModule rewrite_module modules/mod_rewrite.so - Find this text
AllowOverride None
and replace this text withAllowOverride All
. It will appear one or two times. - After doing all these changes. Restart the apache server.
- To check if mod_rewrite is installed or not write this code
phpinfo()
; in any file and see the output. - The output will look like the below image. In the loaded module, you can see mod_rewite.
If you are facing any issue please mention in the comment section.