Forum Moderators: coopster & phranque

Message Too Old, No Replies

RewriteRule for dynamic page

         

Joph

12:24 pm on May 11, 2002 (gmt 0)



Hi!
Need Your urgent help.
URL:.../cgi-bin/shop/shop.pl?id_rubr=2&kategor=man

I want to make the URL look like
../shop/id_rubr/2/kategor/man/ without cgi-bin (!)
OR
../shop/2-man.html

RewriteRule ???

Olaf

12:37 pm on May 11, 2002 (gmt 0)

10+ Year Member



Hi Joph, and welcome to Webmasterworld.

Check out these threads. They should have enough to get you started:

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

for a larger list do a site search (upper left corner [searchengineworld.com...] ) for mod_rewrite

Joph

1:01 pm on May 11, 2002 (gmt 0)



Thanks for usefull links, Olaf!
It will help me going in the right direction %-)

Brett_Tabke

1:08 pm on May 11, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



How about a live example:

RewriteRule ^forum([0-9]+)/index\.htm$ forum.cgi?forum=$1 [T=application/x-httpd-cgi]

First part is the request url. Then the real url, followed by the mime type. In our case, /forumX/index.htm becomes forum.cgi?forum=X

Or something similar to what you want to do:
RewriteRule ^forum([0-9]+)/([0-9\-]+)\.htm$ discussion.cgi?forum=$1&discussion=$2 [T=application/x-httpd-cgi]

Which works out to:
/forumX/ZZZ.htm becomes internally /discussion.cgi?forum=X&discussion=ZZZ

lazerzubb

1:36 pm on May 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, i will take my chance now, since i've always outsourced this part i thougth i might learn it myself.

This is the case.
The websites i have lies on a IIS 5.0 server.
The url presented is
[domain.com...]

(for instance)
If i want this url to be presented as
a .asp or .html file without the ? (or any other charachters that the spiders don't like) in it.

how do i do that?
Is it possible?
Remember it's my first time so you have to explain everything really good ;)

Mikael

5:13 pm on May 11, 2002 (gmt 0)

10+ Year Member



Lazerzubb, all the Mod Rewrite stuff is only possible on Apache, I don't know of any ways of doing something similiar using IIS.