• Home

Logo

Navigation
  • Home
  • Articles
    • Content Writing
    • Design
    • General
    • Internet Marketing
    • Social Media
    • Tools and Tips
    • Usability
    • Web Hosting Articles
  • Tutorials
    • AJAX Tutorials
    • ASP Tutorials
    • C# Tutorials
    • CGI and Perl Tutorials
    • CSS Tutorials
    • Flash Tutorials
    • HTML Tutorials
    • Illustrator Tutorials
    • Java Tutorials
    • JavaScript Tutorials
    • Linux Tutorials
    • Miscellaneous Tutorials
    • MySQL Tutorials
    • Photoshop Tutorials
    • PHP Tutorials
    • Python Tutorials
    • Wireless Tutorials
    • WordPress Tutorials
    • XML Tutorials
  • Scripts
    • AJAX Scripts
    • ASP Scripts
    • ASP.NET Scripts
    • CGI & Perl Scripts
    • Flash Scripts
    • Java Scripts
    • JavaScript Scripts
    • PHP Scripts
    • Python Scripts
    • Remotely Hosted
    • Tools and Utilities
    • XML Scripts
  • Answers
  • Online Services
  • Tools

Setting up mod_rewrite in Ubuntu 7.10 Gutsy Gibon

By Hasin Hayder | on Feb 14, 2008 | 5 Comments
General
  • Tweet
  • Share
  • Tweet
  • Share

Mod_rewrite is a very important library to enable search engine friendly URLs in apache web server. Almost every framework takes advantage of this mod to make user experience more colorful while browsing a page. If you are not sure what is a search engine friendly URL, have a look at the following examples

1. http://your_domain/yourpage.php?param1=list&param2=12
2. http://youor_domain/list/12

In the examples above, second one is more readable than the first one. In fact search engines don’t index pages from a dynamic URL(i.e first example) which ultimately lowers your page rank. Thats why search engine friendly URLs are very important to increase your ranking in search engines.

For web application developers, here is a “how to” to enable mod_rewrite in ubuntu 7.10 (I assume you have apache2 installed in your machine, :D)

Step 1:
sudo cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/

This will copy the available mod_rewrite loader to the appropriate directory. Apache will load all mods by reading these loader present in the “mods-enabled” directory.

Step 2:
If you have one virtual hosting (that means your localhost actually points to /var/www) then change the file “/etc/apache2/sites-enabled/000-default” and replace the following line

AllowOverride None

with

AllowOverride all

Step 3:
Restart your apache server using the following command
sudo /etc/init.d/apache2 restart

Now you need to check out if the mod_rewrite is working properly. Place the following code in a file named “.htaccess” in your localhost (/var/www) and point your browser to “http://localhost”. If you don’t see any 500 internal error, consider its working :)

RewriteEngine On

Easy, huh?

Share this story:
  • tweet

Author Description

5 Responses to “Setting up mod_rewrite in Ubuntu 7.10 Gutsy Gibon”

  1. August 14, 2008

    TheAnomaly Log in to Reply

    FWIW, this saved me like you can’t believe. I just spent the past two hours trying to figure this out–digging through all kinds of complicated junk, and FINALLY, I got here. Your commands worked perfectly, and I’m a happy man.

    Thank you very much.

  2. September 16, 2008

    jacinto Log in to Reply

    thank you. that helped me a lot! Also works with 8.04.

  3. September 22, 2008

    Saulius Log in to Reply

    Thanks, this info was very usefull for me :)

  4. March 5, 2009

    bahodir Log in to Reply

    Thank you man!
    Works great with 8.10 too.
    Stumbled. Thumbs UP.

  5. September 20, 2009

    Mohammad Log in to Reply

    Thank You man, thank you. It was hours that i was engaging without coming to any result

You must be logged in to post a comment.

Connect With Us

RSSSubscribe 0Followers 494Likes
  • Popular
  • Recent
  • Comments
  • Creating Energy Spheres in Photoshop

    Apr 15, 2008 - 96 Comments
  • Easy Screen Scraping in PHP with the Simple HTML DOM Library

    Aug 6, 2008 - 20 Comments
  • Calculating date difference more precisely in PHP

    Mar 7, 2008 - 13 Comments
  • When Does Hosting Your Website in the Cloud Make Sense?

    Oct 8, 2010 - 2 Comments
  • Fun with the Microsoft Managed Extensibility Framework Part 2

    Oct 6, 2010 - 0 Comment
  • Fun with the Microsoft Managed Extensibility Framework Part 1

    Sep 22, 2010 - 0 Comment
  • Website Management on the go with the iPad

    I appreciated your post, but I was looking for something I didn't...
    November 24, 2012 - drmoderator
  • Creating Energy Spheres in Photoshop

    I'm a little stuck down here especially at the step of creating the...
    November 23, 2012 - sarah
  • Running background processes in PHP

    Can you give an example? As see it, you can use this only when you...
    November 16, 2012 - Shaked Klein Orbach
Developer Resources
  • Tutorial Directory
  • Learn HTML
  • Learn PHP
  • Learn CSS
  • Learn AJAX
  • Learn JavaScript
  • Learn Pear
  • White Papers
  • Resources
    • NetVisits Web Directory
    • Realtor Pixels
    • Answers On The Run
    • Ask A Geek
  • Recent Posts

    • When Does Hosting Your Website in the Cloud Make Sense?
    • Fun with the Microsoft Managed Extensibility Framework Part 2
    • Fun with the Microsoft Managed Extensibility Framework Part 1
    • Website Management on the go with the iPad
    • Code Contracts in C# 4.0 – Part 1

    Calendar

    May 2013
    M T W T F S S
    « Oct    
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  

    Recent Comments

    • drmoderator on Website Management on the go with the iPad
    • sarah on Creating Energy Spheres in Photoshop
    • Shaked Klein Orbach on Running background processes in PHP
    • Thomas Cuvillier on How To Upload Files Using PHP
    • rizal aditya on Extracting text from Word Documents via PHP and COM
    • Home
    © 2003 - 2013 DeveloperTutorials.com. All Rights Reserved. Privacy Policy.