Re: mode_rewrite hostnames and wikiwords

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hmmm

hit a snag

how would I expand this rule to capture and convert the following?

your.host.name -> YourHostName (works with rule)
YOUR.HOST.NAME -> YourHostName (currently not handled)
Yo-ur.HOST.name -> YourHostName (currently not handled)

effectively the spec would be to take /doc/FQDN (regardless of case presented)
and capitaliseing every dot separated word returning
/doc/FullyQualifiedDomainName removing any characters other than [A-Z][a-z][0-9]

Many thanks

Phil

On 07/01/2008, Phil Wild <philwild@xxxxxxxxx> wrote:
> Hi Mike,
>
> This worked a treat....
>
> many thanks for your help and knowledge...
>
> Phil
>
> On 05/01/2008, Mike Cardwell <apache-users@xxxxxxxxxxxxxxxxxx> wrote:
> > Phil Wild wrote:
> >
> > > Hello apache experts:-)
> > >
> > > I am trying to rewrite a url which conatins a hostname, converting the
> > > hostname to a wikiword.
> > >
> > > What I have so far is:
> > >
> > > RewriteRule ^/doc/([a-z,A-Z]*.*)\.([a-z,A-Z]*.*)$ /doc/$1$2 [N]
> > > RewriteRule ^/doc/([A-Z]*.*)$ /twiki/bin/view/Main/$1 [PT]
> > >
> > > which takes a URL that looks like
> > >
> > > http://www.example.com/doc/hostname.example.com
> > >
> > > and runs it as
> > >
> > > http://www.example.com/doc/hostnameexamplecom
> > >
> > > which is close but I would really like to run it as
> > >
> > > http://www.example.com/doc/HostnameExampleCom
> > >
> > > Is this possible and if so, how is it done?
> >
> > Something like this maybe?
> >
> > RewriteEngine On
> > RewriteMap    uppercase int:toupper
> > RewriteRule   ^/doc/((.*)\.)?([a-z])(.*)$ /doc/$2${uppercase:$3}$4 [N]
> > RewriteRule   ^/doc/(.*)                  /twiki/bin/view/Main/$1 [PT]
> >
> > Mike
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> >   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> >
> >
>
>
> --
> Tel: 0400 466 952
> Fax: 0433 123 226
> email: philwild@xxxxxxxxx
>


-- 
Tel: 0400 466 952
Fax: 0433 123 226
email: philwild@xxxxxxxxx

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux