Page 1 of 1

mod_rewrite

PostPosted: 30. March 2005 18:31
by bdeonline
I'm needing to use mod_rewrite to capture get request and instead redirect to a page named with the get request.

Example:
test.htm?id=5

Needs to be:
test.htm?id=5.htm

Here is what I have so far:
Code: Select all
RewriteRule ([a-z0-9]+).htm?([a-z0-9]+)=([a-z0-9]+)$ $1.htm?$2=$3.htm

PostPosted: 30. March 2005 19:18
by bdeonline
Reading some more I need {THE_REQUEST} to just add a .htm ending

PostPosted: 30. March 2005 20:38
by LiNx
I don't really understand what you're going to be using this for, but is there any reason why you can just add ".htm" to the end of the id variable?

PostPosted: 30. March 2005 21:12
by bdeonline
I need to make a dynamic site, static.

Using wget I was going to download all the files to the site. Which come with there get request just add .htm to the end and have mod rewrite go to the static page besides a dynamic one.

So each request for test.htm?id=2 would go to a html page called test.htm?id=2.htm

PostPosted: 30. March 2005 22:38
by LiNx
Okay. I see now.