How To Enable / Use .htaccess / Nice permalinks in Apache Web Server on Windows

By Angsuman Chakraborty, Gaea News Network
Monday, October 23, 2006

.htaccess is a web server directive file populalrly used in Apache Web Server in Linux / Unix environment. In windows environment there is a simple way to enable and use .htaccess. Additionally it allows you to create nice permalinks for software like WordPress or phpBB.

To use .htaccess you need to enable mod_rewrite. Even with that I didn’t have much success when I separately installed apache web server and php. However if you install XAMPP it is a piece of cake.

XAMPP automatically installs Apache web server, MySQL database, PHP and a lot of other goodies. It does not however come with mod_rewrite enabled. Let us assume you installed XAMPP in %XAMPP% directory. Then you should open %XAMPP%\apache\conf\httpd.conf in notepad and search for mod_rewrite. You will find a line like:
#LoadModule rewrite_module modules/mod_rewrite.so
Remove the # from the beginning. It will now look:
LoadModule rewrite_module modules/mod_rewrite.so

Restart the Apache web server through XAMPP control panel. You are done!

Discussion

Levani
February 16, 2010: 8:19 am

There is no # sign before LoadModule rewrite_module modules/mod_rewrite.so but I still have the same problem in my VPS hosting! Any ideas?


stefan
November 12, 2009: 7:07 am

hey there… just uncommenting that line isn’t enough to get permalinks realy working. if you have separately installed PHP and Apache scroll down the config after uncommenting that line. You’ll find :
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

change AllowOverride None to AllowOverride All

September 30, 2009: 6:09 am

I recently came across your blog and have been reading along. I thought I would leave my first comment. The blog regarding htacess on linux is really very informative. I don’t know what to say except that I have enjoyed reading. Nice blog keep posting.

August 27, 2009: 8:57 am

Nice post direct to the point.. thanks for the post, ive learned a lot.


Srdjan
June 13, 2009: 2:11 am

Thanx, thanx, thanx, thanx !!!

March 27, 2009: 12:24 pm

i want to restrict to direct access php pages other than “index.php”
Simply index.php must be the entry point for my site.
Can i do this by add some coding to .htaccess file

waiting for reply from all experts.

thanks
Nayana Adassuriya

November 26, 2007: 8:21 am

Thanks, I was just reinstall my PC and try to deploy some of the application for my linux box to windows and found that it not working correctly. It thought that XAMPP will be in the same configuration for both boxes. Turn on mod_rewrite make everything back on track.

August 4, 2007: 1:46 pm

Thanks a lot for the tip.


Veronica
April 15, 2007: 8:31 am

Wanted to test some htaccess tips (they’re fine) and had exactly that problem on my machine with XAMPP–thank you!

October 30, 2006: 2:52 am

[...] XDForum (example: Anaconda Forum) is a nice basic forum software which works seamlessly with WordPress blogs (download our free theme and plugins). Unfortunately it works out-of-the-box with default permalinks only. Most site today use nice permalinks. This mini-tutorial will teach you how to use XDForum with nice permalinks (how to enable; tips and more). [...]

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :