เปิดใช้ Mod Rewrite ของ Apache บน Hardy


Posted in:
gumara's picture

mod rewrite เป็น Module ตัวนึงของ Apache ที่จะทำให้ URL สวยงานขึ้นได้ ซึ่งวิธีเปิด mod rewrite ใน hardy จะแปลกไปกว่า Ubuntu เวอร์ชั่นเก่าๆครับ ส่วนจะเปิดใช้งานยังไงนั้น ขั้นตอนตามนี้เลยครับ

  1. ขั้นแรก ให้เช็คก่อน ว่า mod ทำงานยัง
    สั่ง sudo a2enmod rewrite

  2. ถ้ายังไม่ทำงาน
    สั่ง sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
  3. แก้ไข Site enable
    สั่ง sudo gedit /etc/apache2/sites-enabled/000-default
  4. ที่ AllowOverride none ให้เปลี่ยนจาก none เป็น all
  5. Restart apache
    สั่ง sudo /etc/init.d/apache2 restart

เสร็จเรียบร้อย

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <i> <center> <span> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <br> <dt> <dd> <object> <embed> <hr> <img> <blockquote> <b> <u> <del> <div> <p> <table> <tr> <td> <font>

More information about formatting options