久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在 ubuntu 上的 LAMP 中啟用 mod_rewrite?

How to enable mod_rewrite in LAMP on ubuntu?(如何在 ubuntu 上的 LAMP 中啟用 mod_rewrite?)
本文介紹了如何在 ubuntu 上的 LAMP 中啟用 mod_rewrite?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我在我的機器上使用 Ubuntu 12.04 LTS linux.我已經在上面安裝了 LAMP.現在我想啟用 mod_rewrite 模塊.我做了很多谷歌并嘗試了很多技巧,但無法啟用 mod_rewrite.誰能幫我啟用 mod_rewrite?提前致謝.

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.

推薦答案

TL;DR version -- 在你的終端中執行以下操作:

TL;DR version -- do the following in your terminal:

sudo a2enmod rewrite && sudo service apache2 restart

有解釋——在你的終端中執行以下操作:

With explanations -- do the following in your terminal:

ls -l /etc/apache2/mods-available/rewrite.load    ///if it prints out rewrite.load, it's there and ready to go

sudo a2enmod rewrite   //enables the mod

ls -l /etc/apache2/mods-enabled/rewrite.load // shows created symlink

sudo vi /etc/apache2/sites-available/default   //opens the file in vi (you can also use vim or nano)

根據需要將出現的AllowOverride None"替換為AllowOverride all"

Replace occurrences of "AllowOverride None" with "AllowOverride all" as necessary

sudo service apache2 restart    ///restarts apache

在/etc/apache2/sites-available 中編輯您的虛擬主機條目并將 AllowOverride All 添加到 DocumentRoot.您的虛擬主機最終應如下所示:

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:

<VirtualHost *:80>
  ServerName example.com
  DocumentRoot /var/www/vhosts/example.com
  <Directory /var/www/vhosts/example.com>
    AllowOverride all
  </Directory>
</VirtualHost>

雖然這不適合生產環境,但它適用于本地開發.

Although this isn't suitable for production environments, it works just fine for local development.

這篇關于如何在 ubuntu 上的 LAMP 中啟用 mod_rewrite?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Action View Helper in Zend - Work around?(Zend 中的動作視圖助手 - 解決方法?)
Is this a good way to match URI to class/method in PHP for MVC(這是將 URI 與 PHP 中用于 MVC 的類/方法匹配的好方法嗎)
Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?(我在哪里保存 Zend Framework 中的部分(視圖),以便我的應用程序中的所有視圖都可以訪問?) - IT屋-程序員軟件開發技術
Having a single entry point to a website. Bad? Good? Non-issue?(有一個網站的單一入口點.壞的?好的?沒問題?)
Is MVC + Service Layer common in zend or PHP?(MVC + 服務層在 Zend 或 PHP 中常見嗎?)
Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)
主站蜘蛛池模板: 国内精品视频在线 | 国产高清在线精品 | 亚洲欧美日韩在线 | 亚洲一区二区三区高清 | 国产黄色av网站 | 欧美色性 | 欧美色图综合网 | 四虎影院在线观看av | 日韩精品 电影一区 亚洲 | 欧美日日 | 久久国产一区二区 | 日日夜夜精品免费视频 | 国产精品婷婷 | 伊人伊人网 | 欧美另类视频 | 国产精品v | 国产成人精品一区二区三区四区 | 韩国主播午夜大尺度福利 | 精品一区二区三区四区五区 | 久久久久国产精品一区 | 免费99精品国产自在在线 | 91精品国产91久久久久福利 | 啪一啪 | 精精国产xxxx视频在线野外 | 精品乱子伦一区二区三区 | 亚洲国产精品久久久 | 最新中文字幕在线 | 亚洲男人天堂网 | 国产精品福利网 | 免费一级黄色录像 | 香蕉一区 | 欧美高清视频一区 | 夜夜草导航 | 不卡欧美 | 一区二区三区免费 | 精品久久久久久亚洲综合网 | 手机日韩 | 精品国产乱码一区二区三区a | 欧美成年人网站 | 亚洲不卡视频 | 国产在线观 |