Solution To Url Rewriting Not Working For Wamp Server In Windows
Recently while working on one of the project I faced an issue. I had prepared a virutal machine for local dev environment. Moved live wordpress site localhost local environment. And my permalinks were not working when I moved live wordpress website from production server to local development machine. Clicking any permanent link results into 404 error.
Though its not a new issue or very major issue. It was just not in the list of steps to follow for different environment. So thought of sharing this with everyone.
So to fix this you should enable rewrite_module of apache server from your wamp server. Basically it will change “httpd.conf” file and it will restart your apache server.
Pro Tip: Do you know you can Install Full LAMP Package with single command in Ubuntu Linux or even you can manually Install LAMP-SERVER, linux, apache, mysql, php in Ubuntu Linux version ?
How To Enable rewrite_module of Apache In WampServer ?
To enable rewrite_module just follow these steps
- Click on wampserver icon.
- Click Apache.
- Click Apache Modules.
- Scroll down and make sure that “rewrite_module” is checked and checkbox is present before that.
- If checkbox is not present then just click on it.
- Wampserver will be automatically restarted.
- If wampserver is not restarted then just restart it.
- Refresh your localhost website and now you should be able to browse your website properly.
When using WAMP SERVER if you faced an issue similar to me where you downloaded a backup of wordpress and restored it to your local machine. But after restoring your permanent links no more work. It shows 404 error. Then just try above steps see if it works properly.