Welcome to WebmasterWorld Guest from 54.146.59.202

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

A little help with mod_rewrite

is this possible?

     
12:21 pm on May 20, 2004 (gmt 0)

10+ Year Member



Hi, I know a bit basics of mod_rewrite, but I am not sure about this.

www.domain.com/category/ will lead to category.php
www.domain.com/category/file/ will lead to file.php
www.domain.com/category/file/download will lead to download.php

Possible? Would appreciate for some advice. Thank you.

2:07 pm on May 20, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



expert21,

Yes, it's possible, and easy using either mod_rewrite or mod_alias. Both of these methods use what's called a "back-reference" to identify, save, and then refer back to (copy) part of the requested URI when generating the new URI. Check out RedirectMatch [httpd.apache.org] and RewriteRule [httpd.apache.org] for more information, and look for the phrase "back-reference." You will also need to use regular expressions [etext.lib.virginia.edu] to define/match/extract/save the part of the requested URI you need to "copy" into the new URI. Then have a go at writing and testing the code [webmasterworld.com]. If it doesn't work, post your specific questions, and we'll have a look at them.

Jim

 

Featured Threads

Hot Threads This Week

Hot Threads This Month