On the Internet, we often find URL which has many query strings, like show below:

http://blog.danigunawan.com/joomla15/index.php?option=com_content&view=article&id=19&Itemid=27

URL with form above will be hard to be indexed by the search engine if we compare with the URL below:

http://blog.danigunawan.com/joomla15/joomla-overview

URL which has many query strings can be formatted like in second example using rewrite URL. To rewrite URL, it could be done using certain class in web programming language. I won’t discuss it here. Besides, it can be done using a module in apache web server named mod_rewrite. As default, mod_rewrite is not active.

Module mod_rewrite can be activated by editing apache configuration file. Apache configuration file is usually saved in httdp.conf file. Apache configuration file for XAMPP Windows version can be found in [XAMPP installation directory]/apache/conf. Open httpd.conf with text editor and find the word “mod_rewrite”. For XAMPP Windows version it usually can be found in line 118. As default, in inactive module, there is character “#” in the start of the line (It means that line will not be executed by apache). Example:

#LoadModule rewrite_module modules/mod_rewrite.so

To activate it, we need to remove character # only. After that, restart apache. Module mod_rewrite will active after apache run.

Related posts:

  1. Joomla! 1.5 SEO
  2. Load PHP Extension

Tags:

14 Responses to “Activate mod_rewrite in Apache”

  1. It is not enough to enable mod_rewrite.

  2. @SEO
    Would you tell me?

  3. Hi,
    I have activated mod_reqrite and renamed htaccess.txt to .htaccess.
    But still no success at all…i can see the home page only. But if i click any menu link……it gives me 404 error. Please help.

  4. @mahantesh
    What CMS do you use?

  5. Thank you!..

  6. this is a simple for example active module MOD_rewrite

    http://www.indiabroadband.net/.....write.html

  7. thank u very much

  8. I am unable to find httdp.conf file . I have linux webhost.

  9. in,this is very useful. lose weight

  10. If you can’t find it do this… In SSH window type: “whereis httpd.conf”. It should give you the path of the directory with the file.

  11. Well, I may be a lil late, but I’m gonna do it anyway, just in case anyone else might need it. Renaming the .htaccess and enabling mod_rewrite is certainly a must-do, however, its not gonna automatically do what you want. Hey!! No magic in programming. Usually, in the .htaccess file, there’s a line

    RewriteBase /

    Ok, the forward slash is the key here, it means your index page is located in the root of your server. If you put your index page in a sub-folder like, MyPage, the RewriteBase / goes like this

    RewriteBase /MyPage/

    I hope I don’t confuse anyone cos this is mostly the reason why people can’t use friendly URLs even after enabling mod_rewrite or having the .htaccess file. The other lines of code in the .htaccess, well if you’re using wordpress, modx, joomla,etc. its mostly preconfigured for you. You won’t need to bother much unless you wanna get ur hands dirty and try something else. Have fun coding y’all!!!

  12. @Dave
    Tx for your explanation Dave

Trackbacks/Pingbacks

  1. Joomla! 1.5 SEO | It's About Dani Gunawan
  2. Joomla! 1.5 SEO

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>