Apache Server configuration support - mod_rewrite for both subdomain and query string

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > November 2007 > mod_rewrite for both subdomain and query string





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author mod_rewrite for both subdomain and query string
JamesG

2007-11-23, 7:35 am

Hi there,

I have a rewrite rule that redirects x.domain.com to domain.com/
home.php?stSubdomain=x which works fine.

RewriteRule ^([a-zA-Z0-9\-]*)$ home.php?strSubdomain=$1

I need to have it so that i can use x.domain.com/cid?xxxx
(xxxx can be any number from 0-9)

This new url will be rewritten as domain.com/home.php?
stSubdomain=x&cid=xxxx

Any much appreciated
shimmyshack

2007-11-23, 1:24 pm

On Nov 23, 11:44 am, JamesG <mailmeh...@gmail.com> wrote:
> Hi there,
>
> I have a rewrite rule that redirects x.domain.com to domain.com/
> home.php?stSubdomain=x which works fine.
>
> RewriteRule ^([a-zA-Z0-9\-]*)$ home.php?strSubdomain=$1


do you have anything else rewriteconfig for instance, this cannot be
the rule you are using. It doesnt change the sub into domain and
appends the whole request uri to the query string

>
> I need to have it so that i can use x.domain.com/cid?xxxx
> (xxxx can be any number from 0-9)
>


There's not enough info here what do you mean xxxx (i take it its
different from x.domain...)
usually a query string as some name=value&.... so what does xxxx mean
in your example. a name with no value, which can be something like
2345, or 3455, this doesnt make sense to me unless you are
deliberately populating the args array which is not the normal way.

> This new url will be rewritten as domain.com/home.php?
> stSubdomain=x&cid=xxxx
>
> Any much appreciated


post more exact details, and we can help you do what you are trying to
achieve.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com