Jump to content


This topic is now archived and is closed to further replies.


mod_rewrite for multiple files

Recommended Posts


i want to use mod_rewrite for a site of mine to make it easier for my users to find pages(i have lots of pages)

basically the thing is i have 2 differnt files i want to do this with. opne is a biography page, another is a album detail page.

now this may sound dumb to those who know how to do but do i have to make another .htaccess file for that or place it in the same one?

also something real quick, im testing this on my windows server(it has apache) im wondering if someone knew of a windows-based tutoiral for setting up mod_rewrite on apache as the one found on this site looks like its for linux.

thanks :)

Share this post

Link to post
Share on other sites
To setup mod_rewrite in windows. You need to open httpd.conf and find:
[code]#LoadModule rewrite_module modules/mod_rewrite.so[/code]
Now remove the # infront of that line. Save the httpd.conf file and restart Apache, mod_rewrite is now available

Now when you want to use mod_rewrite you'll want to create a .htaccess file inside in the folder which you want to perform the rewrite rules, the Following is what you'll need to place inside the .htaccess file:
[code]RewriteEngine On[/code]
To turn on the rewrite engine, after that you put your rewrite rules etc.

To create an .htaccess file in Windows, you'll want to open up Notepad. Then goto File > Save
In the filename type in .htaccess. Now underneath the filename box, make sure the file type is set to All Files and not Text File. Now click save.

Share this post

Link to post
Share on other sites
ok that helps a bit :)

now hres something to ask, the files i wish to do this to are in the same folder, will that have to change?

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.