Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite help

tutorial name in dynamic url

         

celox

11:28 pm on Sep 26, 2006 (gmt 0)

10+ Year Member



Hola,

I've been fooling around with SEF URLs for a few months now and I get the basics now, but now I want to take my SEF URLs to the next level.

I want my tutorial names in my rewritten URLs with a "-" for the spacings, example:

Old SEF URL:
[justanexample.cd...]

New SEF URL:
[justanexample.cd...]

Hopefully someone can help me out with this since I'm clueless on this subject!

Thanks in advance,

Celox

jdMorgan

1:58 am on Sep 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll need to use a RewriteMap defined in httpd.conf to detect these new URLs, and call a script which will access your database and translate the "product description" form of the requested URL into the "id-30" form of the URL needed to call your main script.

mod_rewrite by itself can't help; It can add, remove, or re-arrange the characters in a URL, but it has no internal capability as a relational database. So you use a RewriteMap to invoke a script to do the translation.

Or you can modify your main script to do the same thing.

Jim

[edited by: jdMorgan at 1:59 am (utc) on Sep. 27, 2006]

celox

3:00 pm on Sep 27, 2006 (gmt 0)

10+ Year Member



Thanks, I'll go and read some stuff about this. Just to get me going can you post an example on how to do it in the main script? Or is it to long a code to make an example of.

Celox

jdMorgan

4:04 pm on Sep 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The solution depends completely on your current set-up, so posting an example isn't possible. In addition, this is a "project," not something that you'll get a "quick answer" to.

Jim

celox

6:37 pm on Sep 27, 2006 (gmt 0)

10+ Year Member



Well I didn't thought it would be this big, I'll dig into this, thanks.

Celox