Forum Moderators: phranque

Message Too Old, No Replies

Another rewrite noob.

I've been searching, but no luck

         

imstillatwork

12:52 am on Mar 22, 2008 (gmt 0)

10+ Year Member



I have a rewrite that is a little different then all of the examples and how too's that I have found over the past few days...

Current URL format:

ex 1: [cityA.domain.com...]
ex 2: [cityB.domain.com...]

I NEED these to be short and sweet, appearing to be first level folders so businesses can use them in print, etc and be memorable.

ex 1: [cityA.domain.com...]
ex 2: [cityB.domain.com...]

ex 3: [cityB.domain.com...]

I also need to retain access to all my REAL first level folders. All first level folders start with 'gw-' as in 'gw-images', 'gw-templates', 'gw-admin'.

I think i need a rule that first checks if the first level folder in the URL starts with 'gw-' or not.

IF it does, it's a real folder, so do NOT rewrite anything.

IF NOT, we assume it is a business name and rewrite to /gw/index.cfm/$1 where %1 is everything AFTER city.domain.com/

I am so lost, I don't even know were to start.
I'm using ISAPI rewrite 3 for IIS, but you guys have WAY more knowledge of regex and rewrite than the IIS forum. (isapi rewrite is supposed to be compatible with apache .htaccess files also, sooo)

jdMorgan

5:42 am on Mar 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is sort of a "self-help" forum -- Please see our charter.

I'd like to ask that you post your 'best-effort' code for review and discussion.

Thanks,
Jim

imstillatwork

7:01 am on Mar 22, 2008 (gmt 0)

10+ Year Member



Wonderful, thank you.

"I am so lost, I don't even know were to start. "

if self-help forums isn't an oxymoron, I don't know what is. No problem.