Am 20. Februar 2015 00:43:40 MEZ, schrieb "André Warnier" <a...@ice-sa.com>: >André Warnier wrote: >> Felix Schumacher wrote: >>> Am 19.02.2015 um 21:41 schrieb André Warnier: >>>> Jérémie Barthés wrote: >>>> ... >... > >>>> >>>> in the browser, you have to modify your rewrite rules, perhaps by >>>> using a RewriteCond with the -d flag, to check first if the URL >>>> points to an existing directory, and if yes add the terminating "/" > >>>> yourself (with a RewriteRule) before other rewrite tests/rules take > >>>> place. >>> This rewrite.config >>> >>> # if path doesn't end with a slash redirect it to an url with an >>> ending slash >>> RewriteCond %{REQUEST_URI} !^.*/$ >>> RewriteRule ^/mypath/(.*)$ /mypath/$1/ [R] >>> >>> # every path ending on a slash forward to /examples/... >>> RewriteRule ^/mypath/(.*/)$ /examples/jsp/$1 >>> >>> will do the trick. I think -d will not work, since /mypath/async is >>> not existant, it only "feels" like a directory. >> >> Aaah yes, correct. Good catch. Maybe that is why I sub-consciously >> inserted the word "perhaps" above.. ;-) >> > >Actually, upon further examination, I don't think that the rules above >will work >correctly. Because > > >> RewriteCond %{REQUEST_URI} !^.*/$ > >> RewriteRule ^/mypath/(.*)$ /mypath/$1/ [R] > >would also rewrite > > /mypath/my-nifty.jsp > >to > > /mypath/my-nifty.jsp/ > >which is probably not what is intended. >Back to the drawing board..
You are right. It was too simple. > >Maybe adding a prior > >RewriteCond %{REQUEST_URI} !\.(html|jpg|gif|jsp)$ >and then >RewriteCond %{REQUEST_URI} !^.*/$ >RewriteRule ^/mypath/(.*)$ /mypath/$1/ [R] > >RewriteRule ^/mypath/(.*)$ /examples/jsp/$1 > >would do it ? That will only be done correctly by the one who knows the correct and allowed urls. Maybe they have URLs to .exe, .pdf, .jpeg, etc. I think we should stop here as it seems to turn really quick into a mess. Regards Felix > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >For additional commands, e-mail: users-h...@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org