nixCraft Linux Forum

nixCraft

Linux / UNIX 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 ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Linux answers from nixCraft.


Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-03-2008, 01:48 PM
Junior Member
User
 
Join Date: May 2008
OS: Debian
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
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 06:48 PM.
Reply With Quote
  #2 (permalink)  
Old 06-06-2008, 01:01 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Posts: 2,662
Thanks: 11
Thanked 237 Times in 177 Posts
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 Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 06-06-2008, 01:53 PM
Junior Member
User
 
Join Date: May 2008
OS: Debian
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
mumuri is on a distinguished road
Default

thanks for the reply
Reply With Quote
Reply

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 Off


Similar Threads

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


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


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

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 37 38