Benoit Chesneau wrote: > Hi, > > How can I have url ending with or without '/' going to the same > Class ? Is there a "simple" way ?
I'm only going to answer this one because it's easy: regular expressions. Before I elaborate, though, a word of advice: this is /not/ a good idea. Not as you formulate it, at least. Do not make them point to the same class; make them /redirect/ to the right class. This way there will be no two pages with exactly the same content on your website (this confuses bots and many other tools; for example, a browser will not remember going to the page without a / so will not colour it purple-or-whatever, which might confuse the visitor; "huh, didn't I already go there?" etcetera etcetera). No, I am not making this up: google will kill you if you do so (it is not considered a good thing if you have bogus content, and duplicate content is bogus in their eyes). If not google then other search engines. Anyway. Make a regexp that grabs any page without trailing slash, optionally checks if there is an entry with slash defined in the urls list and redirects the user (301). > Btw why if Import myapp and put myapp.views.MyClass in the urls it > doesn't work ? I have to do "from myapp.views import MyClass" and then > put MyClass in urls to have it working. Any idee ? > > Maybe because I use globals() but how to replace it ? > > > many questions for know, juste started to play with webpy ;) > > > - benoƮt Hope this answers your question. b^4 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
