Yorkshire Divers

Deep Blue Technical
Go Back   YD Scuba Diving Forums > Non-Diving Related Forums > Technology
User Name
Password

Welcome to the YD Scuba forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

Technology: Discuss Anyone any good at lighttpd config? specifically url.rewrite in the Non-Diving Related Forums forums: I've been trying to find examples/documentation on url.rewrite and failing, can't get my head round what should be simple (I ...

Reply
 
LinkBack (2) Thread Tools Display Modes
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 11-12-07, 02:07 PM
DannyB's Avatar
YD's resident Wookie
 
Join Date: Apr 2005
Location: Epsom, Surrey
Posts: 1,258
DannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm water
Anyone any good at lighttpd config? specifically url.rewrite

I've been trying to find examples/documentation on url.rewrite and failing, can't get my head round what should be simple (I think...)

current line for the site in lighttpd.conf is

url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )

which is fine for the root page, however I have a separate subfolder which has index.php rather than index.html, I'd like to be able to go to www.domain.com/folder/ and have it server the relevant index.php, it doesn't and I have no idea how to get it to do so!

Heeeelp

Danny
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-12-07, 02:41 PM
loved up
 

Join Date: Aug 2005
Location: York
Posts: 1,024
principia communes with fishprincipia communes with fishprincipia communes with fishprincipia communes with fishprincipia communes with fishprincipia communes with fishprincipia communes with fishprincipia communes with fishprincipia communes with fishprincipia communes with fishprincipia communes with fish
have you got something along the lines of

server.indexfiles = ( "index.html", "index.htm") in the .conf file?

J.
__________________
What were the skies like when you were young?

Pick it
Pack it
Fire it up, come along...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-12-07, 02:54 PM
DannyB's Avatar
YD's resident Wookie
 
Join Date: Apr 2005
Location: Epsom, Surrey
Posts: 1,258
DannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm water
I Currently have

url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )
server.indexfiles = ( "index.php", "index.html" )
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )

Danny
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-12-07, 04:31 PM
DannyB's Avatar
YD's resident Wookie
 
Join Date: Apr 2005
Location: Epsom, Surrey
Posts: 1,258
DannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm water
Quote:
Originally Posted by DannyB
I Currently have

url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )
server.indexfiles = ( "index.php", "index.html" )
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )

Danny
Right getting there...

url.rewrite = ( "^/subfolder/$" => "subfolder/index.php", "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )

gives me it working on www.domain.com/subfolder/ but not on www.domain.com/subfolder (Note the extra / at the end)

Nearly there....

Danny
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-12-07, 05:00 PM
lloydwatkin's Avatar
I like my login so much I put my name on it...
 

Join Date: Apr 2005
Location: Cardiff, Wales
Posts: 1,263
lloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold water
Quote:
Originally Posted by DannyB
Right getting there...

url.rewrite = ( "^/subfolder/$" => "subfolder/index.php", "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )

gives me it working on www.domain.com/subfolder/ but not on www.domain.com/subfolder (Note the extra / at the end)

Nearly there....

Danny
Guessing this is something like mod rewrite in apache?

Easiest way I suppose would be just to have two rules:

url.rewrite = ( "^/subfolder/$" => "subfolder/index.php", "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )

url.rewrite = ( "^/subfolder$" => "subfolder/index.php", "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )

??
__________________
http://www.evilprofessor.co.uk

"Your body goes to waste every minute you don't give it to me..." - Electric Six

SS08 - It Begins...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 11-12-07, 08:07 PM
DannyB's Avatar
YD's resident Wookie
 
Join Date: Apr 2005
Location: Epsom, Surrey
Posts: 1,258
DannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm water
Quote:
Originally Posted by lloydwatkin
Guessing this is something like mod rewrite in apache?

Easiest way I suppose would be just to have two rules:

url.rewrite = ( "^/subfolder/$" => "subfolder/index.php", "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )

url.rewrite = ( "^/subfolder$" => "subfolder/index.php", "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )

??
Looks pretty similar to that, it's trying to get my head round the context of the "^([^.]+)$" that is confusing me, I presume that's the bit that handles the www.domain.com (without the /) but not sure where to put the subdomain in to the expression.

No problem with using two statements (as long as it works the same!) I'll give it a go

All help rewarded with greens!!!!

Danny

Last edited by DannyB : 11-12-07 at 08:08 PM. Reason: Mistake
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-12-07, 08:30 PM
lloydwatkin's Avatar
I like my login so much I put my name on it...
 

Join Date: Apr 2005
Location: Cardiff, Wales
Posts: 1,263
lloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold waterlloydwatkin is a scuba diver - cold water
Look up RegEx, hard stuff, find examples much easier
__________________
http://www.evilprofessor.co.uk

"Your body goes to waste every minute you don't give it to me..." - Electric Six

SS08 - It Begins...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 11-12-07, 11:23 PM
neilh's Avatar
Haemoglobin on the bus...
 

Join Date: Jan 2005
Location: Barnsley
Posts: 2,624
neilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gills
Quote:
Originally Posted by DannyB
Right getting there...

url.rewrite = ( "^/subfolder/$" => "subfolder/index.php", "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )

gives me it working on www.domain.com/subfolder/ but not on www.domain.com/subfolder (Note the extra / at the end)

Nearly there....

Danny
You could try:
url.rewrite = ( "^/subfolder[/]?$" => "subfolder/index.php", "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )

I must admit I don't know this httpd though and the second of your original rule puzzles me a bit. The first seems to be replacing a request for the root of your site with index.html which is fair enough, but the second seems to shift requests for any paths to be index.html/whatever which seems odd.

E.g. "/subfolder/" becomes "index.html/subfolder/"

Anyway, give it a try and see if it works
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 12-12-07, 10:56 AM
DannyB's Avatar
YD's resident Wookie
 
Join Date: Apr 2005
Location: Epsom, Surrey
Posts: 1,258
DannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm waterDannyB is a scuba diver - warm water
Quote:
Originally Posted by neilh
You could try:
url.rewrite = ( "^/subfolder[/]?$" => "subfolder/index.php", "^/$" => "index.html", "^([^.]+)$" => "index.html/$1" )

I must admit I don't know this httpd though and the second of your original rule puzzles me a bit. The first seems to be replacing a request for the root of your site with index.html which is fair enough, but the second seems to shift requests for any paths to be index.html/whatever which seems odd.

E.g. "/subfolder/" becomes "index.html/subfolder/"

Anyway, give it a try and see if it works
Tried that, domain.com/subfolder/ is still working domain.com/subfolder now goes to domain.com/index.php

As for the second bit, no idea what it does was set like that by default.

Regards,

Danny
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 12-12-07, 11:42 AM
neilh's Avatar
Haemoglobin on the bus...
 

Join Date: Jan 2005
Location: Barnsley
Posts: 2,624
neilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gillsneilh was born with gills
Quote:
Originally Posted by DannyB
Tried that, domain.com/subfolder/ is still working domain.com/subfolder now goes to domain.com/index.php
Eh?! That sounds like something else is going on then - I can't see how the rewrite rules you have can end up with that!

Can you PM me the full config and I'll see if I can spot anything?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.yorkshire-divers.com/forums/technology/64867-anyone-any-good-lighttpd-config-specifically-url-rewrite.html
Posted By For Type Date
technology » Blog Archive » Anyone any good at lighttpd config? specifically url.rewrite This thread Pingback 11-12-07 08:39 PM
technology » Blog Archive » Anyone any good at lighttpd config? specifically url.rewrite This thread Pingback 11-12-07 08:39 PM


Sponsored Links

Yorkshire Divers - RSS Feed
All times are GMT +1. The time now is 03:27 PM.
Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Trademark and all rights reserved : © YD.com Ltd (2006)
YD.com Ltd (Registered in England - 05886696)
Other sites : Golf Clubs | New Premiership Football Kits | MP3 Portable Players | MP3 Players For Sale | Replica Football Kits | Cheap Football Boots

Forums Directory