homepage Welcome to WebmasterWorld Guest from 54.211.219.178
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
A little help with mod_rewrite
is this possible?
expert_21




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

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.

 

jdMorgan




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved