nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Lighttpd URL Redirection domain.com/dir1/index.html to domain.com/dir1

This is a discussion on Lighttpd URL Redirection domain.com/dir1/index.html to domain.com/dir1 within the Web servers forums, part of the Mastering Servers category; hello how can we redirect a page like Code: http://nixcraft.com/web-servers/index.html to Code: http://nixcraft.com/web-servers/ with lighttpd ? thanks in advance i ...


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-03-2008, 12:48 PM
Junior Member
User
 
Join Date: May 2008
My distro: Debian
Posts: 9
Rep Power: 0
mumuri is on a distinguished road
Default Lighttpd URL Redirection domain.com/dir1/index.html to domain.com/dir1

hello

how can we redirect a page like

Code:
http://nixcraft.com/web-servers/index.html
to

Code:
http://nixcraft.com/web-servers/
with lighttpd ?

thanks in advance

i tried a
Code:
url.rewrite-once = (
         "^/[a-zA-Z0-9-]+\/index\.html$" => "$1"
)
but it doesn't seem to work
PS :rewrite is on

Last edited by mumuri; 06-03-2008 at 05:48 PM.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-06-2008, 12:01 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 973
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

You need to use url.redirection as follows:
Code:
url.redirect = ( "^/([a-zA-Z0-9]+)/index\.html$" => "%1/$1" )
  1. %1 : Your domain.com
  2. $1 : Your matched rule ([a-zA-Z0-9]+)
All rules grouped using () syntax. Turn on mod_redirect and use above rule for seo benefit.
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 06-06-2008, 12:53 PM
Junior Member
User
 
Join Date: May 2008
My distro: Debian
Posts: 9
Rep Power: 0
mumuri is on a distinguished road
Default

thanks for the reply
Reply With Quote
Reply

Bookmarks

Tags
clean urls , lighttpd , lighttpd seo , mod_redirect , mod_rewrite , seo


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
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

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

Similar Threads

Thread Thread Starter Forum Replies Last Post
awk - Removing domain name entires nvbhole Shell scripting 0 12-18-2007 11:14 AM
wi-fi connection and Domain login on windows surmandal Computer Networking and Internet/broadband 2 08-03-2007 06:51 PM
Masquerade domain sendmail how to chiku Mail Servers 2 07-10-2007 08:20 AM
lighttpd domain and subdomain settings muks Web servers 4 03-08-2007 06:39 PM
Help, samba 3.0.23 join ads domain warren Linux software 1 01-09-2007 03:41 PM


All times are GMT +5.5. The time now is 04:41 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36