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:
Tags: Apache








March 16th, 2009 at 11:49 pm
It is not enough to enable mod_rewrite.
March 17th, 2009 at 6:11 am
@SEO
Would you tell me?
May 25th, 2009 at 4:02 pm
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.
May 29th, 2009 at 12:07 am
@mahantesh
What CMS do you use?
August 23rd, 2009 at 7:01 pm
Thank you!..
September 30th, 2009 at 1:36 pm
this is a simple for example active module MOD_rewrite
http://www.indiabroadband.net/.....write.html
November 4th, 2009 at 2:15 pm
thank u very much
December 15th, 2010 at 8:12 pm
I am unable to find httdp.conf file . I have linux webhost.
February 15th, 2011 at 9:08 pm
in,this is very useful. lose weight
May 6th, 2011 at 9:58 am
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.
May 9th, 2011 at 5:44 pm
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!!!
May 9th, 2011 at 9:29 pm
@Dave
Tx for your explanation Dave