Jump to content


Photo

mod_rewrite for multiple files


  • Please log in to reply
2 replies to this topic

#1 darkcarnival

darkcarnival
  • Members
  • PipPipPip
  • Advanced Member
  • 162 posts

Posted 29 July 2006 - 03:04 PM

hi,

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 :)

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 30 July 2006 - 10:31 AM

To setup mod_rewrite in windows. You need to open httpd.conf and find:
#LoadModule rewrite_module modules/mod_rewrite.so
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:
RewriteEngine On
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.

#3 darkcarnival

darkcarnival
  • Members
  • PipPipPip
  • Advanced Member
  • 162 posts

Posted 30 July 2006 - 04:41 PM

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users