I will answer myself :)
I'm using thie .htaccess:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi/$1 [QSA,L]
This redirects all the requests to files that don't exists to
dispatch.cgi (pylons).
Routes uses environ['SCRIPT_NAME']. So, when I generate a url with
h.url*, it brings me the dispatch.cgi part.
I changed that with a middleware:
class CleanMiddleware(object):
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
environ['SCRIPT_NAME'] =
environ['SCRIPT_NAME'].replace('/dispatch.cgi','')
app = self.app(environ,start_response)
return app
[]'s
- Walter
On 7/20/07, Walter Cruz <[EMAIL PROTECTED]> wrote:
> Hi. I'm testing a Pylons app throug cgi.
>
> I have configured clean urls through .htaccess..
>
> In the example above:
>
> h.url_for(controller='manage',action='edit',id=pagina.id)
>
> It generates a link as :
>
> http://localhost/artigos/roda.cgi/manage/edit/11
>
> But I want to strip the roda.cgi!
>
> If I access
>
> http://localhost/artigos/manage/edit/11
>
> How do I tell to Pylons to get rid of the cgi filename?
>
> []'s
> - Walter
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---