Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7570661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:28:59+00:00 2026-05-30T15:28:59+00:00

I want Lighttpd to display a different page for internal clients and the default

  • 0

I want Lighttpd to display a different page for internal clients and the default page for everyone else.

Between these two links, I have an idea of what I want to do but am not sure of the RegEx I would need to restrict clients using a hostname of [http://]192.168.0.? or [http://]192.168.?.? to a different page. I’ve been using the following code in lighttpd.conf:

server.document-root       = "/var/www/sites"

$HTTP["host"] == "RegExHere" {
        server.document-root    = "/var/www/setup"
}

…where for ‘RegExHere’ I have tried a variety of attempts such as:

192\.168\.0\.\d{1,3}(\s|$))+
192\.168\.
[192.168.[0-9]+.]
192\.168\.[0-9]+.[0-9]+$

…and various combinations thereof. I have no idea whether I’m close, but regardless it only shows me the default page.

Can anyone advise where I may be going wrong please?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:29:01+00:00Added an answer on May 30, 2026 at 3:29 pm

    You have to use the =~ syntax to match a regex. Change $HTTP["host"] == "RegExHere" to $HTTP["host"] =~ "RegExHere" and one of those regexs should work. ^192\.168\.\d{1,3}\.\d{1,3}$ should do it.

    Found this article on it http://blog.evanweaver.com/2006/06/07/regular-expressions-in-lighttpd-host-redirects/

    edit: I think you need to use $HTTP[“remoteip”] instead of $HTTP[“host”] and it looks like you can do it without regexes.

    $HTTP["remoteip"] == "10.0.0.0/8" { url.access-deny = ("") }
    
    $HTTP["remoteip"] == "127.0.0.0/8" { url.access-deny = ("") }
    

    http://forum.lighttpd.net/topic/27

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

want to have a Hyperlink-Button in a gridView in which I can display a
Want to display the splash page for iphone and android web browser. I am
I want to setup my lighttpd server to proxy some requests (for ex. RSS
Want to build up a csv file, call up the default email app and
Want to verify that my understanding of how this works. Have a C++ Class
Want to have vertical scroll bar if content is more than expected in popwindow...
Want to check that my site map contains a page. Could just iterate through
Want to attach an Event Handler/Listener to some links using the delegate() method, but
In my lighttpd config file, I have a rewrite rule like this: $HTTP[host] ==
Want to know which CSS styles are currently being used on a web page.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.