Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite - a rule based on first letter of a directory?

         

URLMonkey

12:16 am on Mar 26, 2004 (gmt 0)



Hello,

I am a mod_rewrite newbie. Can someone help me create a rule, perhaps using a map, to change urls based upon the first letter of the first directory after the server root?

For example,
[server.com...] gets mapped to /contenta/apple/index.html
and
[server.com...] is mapped to /contenta/apple/slice/index.php

similarly,
[server.com...] maps to /contentb/bananna/slice/peel/index.php
and
[server.com...] to /contentb/bananna/index.php

I hope that is clear ... files off the root such as [site.com...] would also get their own mapping to /content_index or something like that.

Thank you for the help!

jdMorgan

6:41 pm on Mar 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



URLMonkey,

Welcome to WebmasterWorld [webmasterworld.com]!

Here's a good place to start: Introduction to mod_rewrite [webmasterworld.com]

Jim