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 8423813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:49:39+00:00 2026-06-10T03:49:39+00:00

I currently try to translate a .htaccess file which is provided by the chyrp

  • 0

I currently try to translate a .htaccess file which is provided by the chyrp installation routine to lighttpd via the mod_rewrite module.

The source .htaccess file is as follows:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {$index}
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.+$ index.php [L]
</IfModule>

Directory layout (webroot)

/chyrp/
/chyrp/includes/
/chyrp/admin/
/chyrp/feathers/
/chyrp/modules/
/chyrp/themes/

My current attempt

    index-file.names = ( "index.php" )
    url.access-deny = ( ".twig" )

    #taking care of the directory, check if it is one of the known ones, if so go on
    #if it is not, redirect to index
    url.rewrite-once = (
            "^/(|chyrp/)(admin|themes|feathers|modules|includes)(.*)$" => "/chyrp/$2$3",
            "^/(|chyrp/).*/$" => "/chyrp/index.php"
    )

    #check if files exists, if not rewrite to a index.php in the same directory
    url.rewrite-if-not-file = (
            "^/(|chyrp/)(admin|themes|feathers|modules|includes)(/(index.php)?(.*))?$" => "/chyrp/$2/index.php$5",
            "^/(|chyrp/)(.*)" => "/chyrp/index.php"
    )

It mostly works, except for the search functionality (testable here: srctwig.com), which does not rewrite correctly (at least that’s my guess) or somewhere the query gets lost.
The search routine itself works properly (demonstration search with 0 results)
A working demo of chyrp can be seen at chyrp demo on apache2

What am I doing wrong?

  • 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-06-10T03:49:41+00:00Added an answer on June 10, 2026 at 3:49 am

    The reason for the issue was, I was not aware of having to dissect the url in order to extract the get query string which I needed to preserve according to a lighttpd mod_rewrite wiki entry

        url.rewrite-once = (
                "^/(|chyrp/)(admin|themes|feathers|modules|includes)/(.*)$" => "/chyrp/$2/$3",
                "^/(|chyrp/).+/(([^\?]+)?(\?.+)?)$" => "/chyrp/index.php$2"
        )
    
        url.rewrite-if-not-file = (
            "^/(|chyrp/)(admin|themes|feathers|modules|includes)(/([^\?]+)?(\?.+)?)?$" => "/chyrp/$2/index.php$5",
            "^/(|chyrp/)(([^\?]+)?(\?.+)?)$" => "/chyrp/index.php$2",
            "^/(|chyrp/).*$" => "/chyrp/index.php"
        )
    

    Dissect:

    url.rewrite-once

    "^/(|chyrp/)(admin|themes|feathers|modules|includes)/(.*)$" => "/chyrp/$2/$3",
    

    These directories exist. Do not change anything except for ensuring the proper prefix if not alread there.

    "^/(|chyrp/).+/(([^\?]+)?(\?.+)?)$" => "/chyrp/index.php$2"
    

    Check if a non existant subdir was requested and check for ?, treat everything after that as php get query and append it to the rewrite target.

    url.rewrite-if-not-file

    "^/(|chyrp/)(admin|themes|feathers|modules|includes)(/([^\?]+)?(\?.+)?)?$" => "/chyrp/$2/index.php$5",
    

    if the target does not exist just swap out the filename and keep the query (as above)

    "^/(|chyrp/)(([^\?]+)?(\?.+)?)$" => "/chyrp/index.php$2",
    

    go to the basefolder if none of the above matches and try to still pass the query

    "^/(|chyrp/).*$" => "/chyrp/index.php"
    

    this very last one is just for testing (put foobarfailure.php there to assert it never reaches that line)

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

Sidebar

Related Questions

i currently try to import some XML via XMLSimple in my RoR-3 App. on
I currently try to use Reachability in iOS 5.1 on iPad. There is a
I am currently try to retrieve a latitude and longitude value from a location.
I'm currently (I try to) designing a RESTful API for a social network. But
I am a total beginner to Objective C. Currently I try to display a
Im currently facing the problem that when i try to set focus on some
I currently have MVS2008 and I want to try the 2010 version hoping that
I am currently using code similar to this: try { // IE ONLY var
I'm currently reading through this jquery masking plugin to try and understand how it
I am currently using two catch blocks after a try block. The first catches

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.