I'm using Ubuntu 12.04 LTS linux on my machine. I've already installed LAMP on it. Now I want to enable the mod_rewrite module. I did google a lot and tried lots of tricks but couldn't be able to enable mod_rewrite. Can anyone help me to enable the mod_rewrite? Thanks in advance.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
TL;DR version -- do the following in your terminal:
With explanations -- do the following in your terminal:
Replace occurrences of "AllowOverride None" with "AllowOverride all" as necessary
Edit your virtual host entry in /etc/apache2/sites-available and add
AllowOverride All
to the DocumentRoot. Your virtual host should ultimately look something like this:Although this isn't suitable for production environments, it works just fine for local development.
You didn't mention what commands did you try, so I will start with the basic one:
You can also check if mod rewrite is already enable using: