Dec 04, 2008, 01:12 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: [1]   Go Down
  Print  
Author Topic: [Tip] Friendly URLs on lighthttpd  (Read 2801 times)
0 Members and 1 Guest are viewing this topic.
netnoise
Coding Team
*
Posts: 212



WWW
« on: Jan 11, 2006, 02:33 PM »

Hope this could save you some time getting friendly urls to work on lighthttpd:

Code:
url.rewrite-once = ( "^/([äöüÄÖÜa-zA-Z0-9\_\-]*)\.html$" => "/index.php?q=$1",)

(The regex above assumes you have set your friendly alias suffix to '.html'. It doesn't work with friendly paths.)
« Last Edit: Jan 13, 2006, 07:51 AM by netnoise » Logged

davidm
Marketing & Design Team
*
Posts: 6,777


The best way to predict the future is to invent it


WWW
« Reply #1 on: Jan 11, 2006, 02:34 PM »

Nice one, given the increasing popularity of lighthttpd Cheesy

Thanks for sharing !
Logged

.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.45 - PHP 5.2.6 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net
netnoise
Coding Team
*
Posts: 212



WWW
« Reply #2 on: Jun 09, 2006, 05:35 AM »

* Updated: *
Code:
url.rewrite-once = ( "^/(assets|manager)/(.*)$" => "/$1/$2",
                     "^/(.*)\?(.*)$" => "/index.php?q=$1&$2",
                     "^/(.*)$" => "/index.php?q=$1",
                   )
Logged

wilkart
Jr. Member
*
Posts: 1


« Reply #3 on: Aug 17, 2006, 09:37 AM »

It doesn't work correctly when I go to url without .html. For example http://modcms.com/index.html works correctly but not http://modcms.com/. I resolved this problem by mixing both codes:
Code:
url.rewrite-once = ( "^/(assets|manager)/(.*)$" => "/$1/$2",
                     "^/(.*)\?(.*)$" => "/index.php?q=$1&$2",
                     "^/([-9\_\-]*)\.html$" => "/index.php?q=$1",
                   )
Logged
netnoise
Coding Team
*
Posts: 212



WWW
« Reply #4 on: Aug 17, 2006, 02:32 PM »

You're right, I didn't update it Wink
My newest one, which should work independently of the friendly URL suffix:
Code:
url.rewrite-once = ( "^/(assets|manager)/(.*)$" => "/$1/$2",
                     "^/(.*)\?(.*)$" => "/index.php?q=$1&$2",
                     "^/(.*)$" => "/index.php?q=$1",
                   )
Logged

tcsoft
Jr. Member
*
Posts: 13



« Reply #5 on: Feb 06, 2007, 01:14 PM »

i felt free to extend your rules to work with the snippet ajaxsearch

Code:
url.rewrite-once = (
  "^/(assets|manager)/(.*)$" => "/$1/$2",
  "^/(?!index-ajax)(.*)\?(.*)$" => "/index.php?q=$1&$2",
  "^/(?!index-ajax)(.*)$" => "/index.php?q=$1"
)
Logged

01110110 01101001 01101101  01110010 01110101 01101100 01100101 01111010
milicicd
Member
**
Posts: 59



« Reply #6 on: Feb 06, 2007, 01:48 PM »

Wikified: http://wiki.modxcms.com/index.php/Friendly_URLs_on_lighttpd
Please update with any later changes. Thanx!
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!