Personal tools
You are here: Home Lists ZPUG DC List Archives 2005 2005-06 Question about URLs / "Bill Fergus" <bill@oai-usa.com>
Navigation
Log in


Forgot your password?
New user?
Mailing Lists
You can read our ZPUGDC mailing list archives online.
You can subscribe to our mailing list:
Book Review

The Definitive Guide to Plone

Reviewer: joel
 

Question about URLs / "Bill Fergus" <bill@oai-usa.com>

Question about URLs
"Bill Fergus" <bill(at)oai-usa.com>
2005-06-08 15:34:31 [ FULL ]
Is there a way to make zope serve a website if the user capitalizes any
of the letters in the url? I have a url that is similar to the
following:

 

            www.domain.com/icfj

 

My staff wants to be able to put in either the url above or the
following one and reach the same page:

 

            www.domain.com/ICFJ

 

I have tried using VHM for this but was unsuccessful.

 

Any help is greatly appreciated.

 

Bill

 

Bill Fergus

Systems Administrator

Orr Associates, Inc.

2801 M Street NW

Washington, DC 20007

(202) 338-6100 x138

bill(at)oai-usa.com
Attachments: 
text.html text/html - 4471 Bytes

Re: [ZPUGDC] Question about URLs / Alex Clark <aclark@aclark.NET>

Re: [ZPUGDC] Question about URLs
Alex Clark <aclark(at)aclark.NET>
2005-06-08 16:03:30 [ FULL ]
Well, first of all CAPS in the URL is gross, but if you must do it then 
I suppose you could do it with apache rewrites, I just tested this on
aclark.net
and it appears to work (http://www.aclark.net/ICFJ):

1. create lower case dir icfj in Plone.

2. add rewrite rule to httpd.conf: 
	RewriteRule ^/ICFJ(.*) http://localhost:8080/VirtualHostBase/http/www.aclark.net:80/aclark.net/VirtualHostRoot/icfj/$1
[P,L]

Alex

On Wed, Jun 08, 2005 at 04:35:05PM -0400, Bill Fergus wrote:[...]
[...]

Re: [ZPUGDC] Question about URLs / Joel Burton <joel@joelburton.com>

Re: [ZPUGDC] Question about URLs
Joel Burton <joel(at)joelburton.com>
2005-06-08 16:27:48 [ FULL ]
On Wednesday 08 June 2005 8:35 pm, Bill Fergus wrote:[...]

You could do an in-Zope solution for this (using a custom traversal hook or 
such), but the easiest thing would be to have Apache handle this via a 
RewriteRule.

Remember that one or two things should *not* be 
rewritten--ie, /Control_Panel/manage should stay uppercased, as should the 
folder "Member" (unless you rename the actual folder "member").

Perhaps a talk on Apache RewriteRules would be in order? They're essentially 
for the smart web developer. Jules would be excellent at that.

- j.

Re: [ZPUGDC] Question about URLs / Joel Burton <joel@joelburton.com>

Re: [ZPUGDC] Question about URLs
Joel Burton <joel(at)joelburton.com>
2005-06-08 16:30:05 [ FULL ]
On Wednesday 08 June 2005 9:11 pm, Alex Clark wrote:[...]

You should be able to write a rule that converts *all* URLS to lowercase, 
which would be much nicer than doing it one by one.

Also, see the product at http://plone.org/products/redirectiontool,
which 
shows examples of in-zope/plone redirection based on searching.

- j.

RE: [ZPUGDC] Question about URLs / "Bill Fergus" <bill@oai-usa.com>

RE: [ZPUGDC] Question about URLs
"Bill Fergus" <bill(at)oai-usa.com>
2005-06-08 16:34:05 [ FULL ]
Thanks Alex, I will try tomorrow and let you know!

-----Original Message-----
From: Alex Clark [mailto:aclark(at)aclark.NET] 

Well, first of all CAPS in the URL is gross, but if you must do it then 
I suppose you could do it with apache rewrites, I just tested this on
aclark.net
and it appears to work (http://www.aclark.net/ICFJ):

1. create lower case dir icfj in Plone.

2. add rewrite rule to httpd.conf: 
	RewriteRule ^/ICFJ(.*)
http://localhost:8080/VirtualHostBase/http/www.aclark.net:80/aclark.net/
VirtualHostRoot/icfj/$1 [P,L]

Alex

RE: [ZPUGDC] Question about URLs / "Bill Fergus" <bill@oai-usa.com>

RE: [ZPUGDC] Question about URLs
"Bill Fergus" <bill(at)oai-usa.com>
2005-06-08 16:35:10 [ FULL ]
Sounds like a good idea.

-----Original Message-----
From: Joel Burton [mailto:joel(at)joelburton.com] 

You should be able to write a rule that converts *all* URLS to
lowercase, 
which would be much nicer than doing it one by one.

Also, see the product at http://plone.org/products/redirectiontool,
which 
shows examples of in-zope/plone redirection based on searching.

- j.

RE: [ZPUGDC] Question about URLs / "Bill Fergus" <bill@oai-usa.com>

RE: [ZPUGDC] Question about URLs
"Bill Fergus" <bill(at)oai-usa.com>
2005-06-08 16:35:40 [ FULL ]
Thanks

-----Original Message-----
From: Joel Burton [mailto:joel(at)joelburton.com] 

On Wednesday 08 June 2005 8:35 pm, Bill Fergus wrote:[...]
any[...]

You could do an in-Zope solution for this (using a custom traversal hook
or 
such), but the easiest thing would be to have Apache handle this via a 
RewriteRule.

Remember that one or two things should *not* be 
rewritten--ie, /Control_Panel/manage should stay uppercased, as should
the 
folder "Member" (unless you rename the actual folder "member").

Perhaps a talk on Apache RewriteRules would be in order? They're
essentially 
for the smart web developer. Jules would be excellent at that.

- j.

Re: [ZPUGDC] Question about URLs / David Diskin <david.diskin@verizon.net>

Re: [ZPUGDC] Question about URLs
David Diskin <david.diskin(at)verizon.net>
2005-06-08 17:15:42 [ FULL ]
great idea Joel.  I for one don't know anything about Rewrite  
Rules.   David

On Jun 8, 2005, at 5:28 PM, Joel Burton wrote:
[...][...][...]

Re: [ZPUGDC] Question about URLs / Jules <jules@jules.com>

Re: [ZPUGDC] Question about URLs
Jules <jules(at)jules.com>
2005-06-08 17:38:21 [ FULL ]
The Apache regex library is quite good enough to do this. As you would  
with a python regex you just add a flag for case insensitivity and do  
the transform.

<VirtualHost *>
     RewriteEngine On
     ServerName www.example.com
     RewriteMap    lowercase    int:tolower
     RewriteRule (.*)  ${lowercase:$1}
     RewriteRule ^/(.*)  
http://127.0.0.1:8080/VirtualHostBase/http/www.example.com:80/

VirtualHostRoot/$1 [P,L]
</VirtualHost>

That should do it for ICFJ, icfj IcFj, etc. Pulled this from memory so  
stress test it in development before hurling it into production.

On Jun 8, 2005, at 4:35 PM, Bill Fergus wrote:
[...]
People in the 1960's and 1970's had much larger ankles than people of
  today. This was the reason for the design of flared trousers.

Re: [ZPUGDC] Question about URLs / Joel Burton <joel@joelburton.com>

Re: [ZPUGDC] Question about URLs
Joel Burton <joel(at)joelburton.com>
2005-06-08 17:47:24 [ FULL ]
On Wednesday 08 June 2005 10:39 pm, Jules wrote:[...]

I believe that, by this post, Jules just *volunteered* for that presentation 
on RewriteRules, hmmm? ;)

Cheers,

- j.

Re: [ZPUGDC] Question about URLs / Alex Clark <aclark@aclark.NET>

Re: [ZPUGDC] Question about URLs
Alex Clark <aclark(at)aclark.NET>
2005-06-08 18:00:19 [ FULL ]
That rocks! 

I took a quick look at the docs after Joel suggested
rewriting everything from upper to lower... and I came accross
RewriteMap. 

Thanks Joel/Jules.

On Wed, Jun 08, 2005 at 06:39:01PM -0400, Jules wrote:[...]
[...]

RE: [ZPUGDC] Question about URLs / "Bill Fergus" <bill@oai-usa.com>

RE: [ZPUGDC] Question about URLs
"Bill Fergus" <bill(at)oai-usa.com>
2005-06-08 18:29:05 [ FULL ]
I will attempt to implement this tomorrow morning. I'm not sure about
how much control I have over Apache because my instance is hosted by
Zettai. I'm sure George would be glad to help but this is interesting
and I'd like to learn.

Jules, do you imagine this is something I can implement on my own or
shall I request help from George?

THANKS!

-----Original Message-----
From: Joel Burton [mailto:joel(at)joelburton.com] 
Sent: Wednesday, June 08, 2005 6:48 PM
To: zpugdc(at)lists.zpugdc.org
Subject: Re: [ZPUGDC] Question about URLs

On Wednesday 08 June 2005 10:39 pm, Jules wrote:[...]

I believe that, by this post, Jules just *volunteered* for that
presentation 
on RewriteRules, hmmm? ;)

Cheers,

- j.

Re: [ZPUGDC] Question about URLs / Jules <jules@jules.com>

Re: [ZPUGDC] Question about URLs
Jules <jules(at)jules.com>
2005-06-08 19:08:38 [ FULL ]
I'd fall on the mercy of George unless you strut some .htaccess-fu. He 
will prolly have to create you a separate <VirtualHost> outside of the 
global one I'd imagine.

On Jun 8, 2005, at 7:29 PM, Bill Fergus wrote:
[...]

--
The sun will go out on July 17th 2007 unless someone puts another 500
  Pesos in the meter.

Re: [ZPUGDC] Question about URLs / Jules <jules@jules.com>

Re: [ZPUGDC] Question about URLs
Jules <jules(at)jules.com>
2005-06-08 19:11:15 [ FULL ]
Me and my big mouth, um, fingers.

Actually I'll solicit 10 "how'd you do such-and-such" on or off list 
and gladly dissect them in front of the group. This should see if 
there's enough interest.

On Jun 8, 2005, at 6:48 PM, Joel Burton wrote:
[...]
--
The Internet was stolen in 1978 from legendary programmer Jeff Minter.
  Then known as the "Minternet", it was used for the sole purpose of
  marketing Minter's creations, such as Llama Rama, Camel Wars and
  Sheep in Space.

Re: [ZPUGDC] Question about URLs / Jules <jules@jules.com>

Re: [ZPUGDC] Question about URLs
Jules <jules(at)jules.com>
2005-06-08 19:41:13 [ FULL ]
One other thing:

You can test this out locally on your Mac/*nix machine buy editing 
/etc/hosts and adding

	127.0.0.1 www.example.com

Then config

	/etc/httpd/httpd.conf

(or wherever your machine stashes it)

You might have to bounce your browser. Should work on Windows as well 
if you've got Apache installed. Start / Run and then

	notepad %systemroot%\system32\drivers\etc\hosts

This file might not exist so if you do use notepad make sure you save 
it as "hosts" (with the quotes) or Windows will bung .txt on the end. 
And you'll probably have to reboot as changing anything other than the 
mouse position the screen generally requires a reboot to take.

On Jun 8, 2005, at 7:29 PM, Bill Fergus wrote:
[...]
--
The "halls" of Montezuma were actually a set of over 15,000 closets,
  the most extensive set of wardrobes in the world at the time.

Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: