How to enable rewrite mode for apache in ubuntu?

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Today now in this post i would like to share with you how to enable rewrite mode for apache in ubuntu .Whenever we have need to rewrite index.php file from the url we can find this solution here. we can do this easily enable and rewrite mode by using the bellow terminal command. when we are create one virtual host for our laravel application and then need to open in browser and open our created virtual url. but when i was click on login then i was found following error :

URL not found....

But when i was try to add index.php like this way then it was working good:

http://test.hd/index.php/login

So we can remove our index.php from the url. so need to run following command:

sudo a2enmod rewrite
sudo service apache2 restart

Now we can open this way:

http://test.hd/index.php/login

Read Also : How to convert Object into Array in PHP?

Thanks for read. I hope it help you. For more you can follow us on facebook.

About code chef

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by code chef →