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

  • Home
  • SEARCH
  • 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 6868209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:24:21+00:00 2026-05-27T03:24:21+00:00

I’m having problems to setup Lighttpd rewrite rule for a WordPress instalation that is

  • 0

I’m having problems to setup Lighttpd rewrite rule for a WordPress instalation that is located inside a CakePHP app.

The folder structure looks like this:

var/
    www/
        app/
            webroot/
                blog/
        cake/
        vendors/

The cakePHP app works fine. If I try to access http://domain.tld, it loads the app front page. Any attempt to access a controller/action also works fine. The problem happens when I try to load any wordpress post. The url structure to access a WP post is this: http://domain.tld/blog/post/post-slug

What I have right now on /etc/lighttpd/lighttpd.conf is this

$HTTP["host"] == "domain.tld" {
    server.document-root        = "/var/www/app/webroot/"
    url.rewrite-once = (
        "/(css|files|img|js|php)/(.*)" => "/$1/$2",
        "^([^\?]*)(\?(.+))?$" => "/index.php?url=$1&$3",
    )
}

$HTTP["url"] == "domain.tld/blog/" {
    server.document-root        = "/var/www/app/webroot/blog/"
    url.rewrite-final = (
        "^/(wp-admin|wp-includes|wp-content|gallery2)/(.*)" => "$0",
        "^/(.*.php)" => "$0",
        "^/(.*)$" => "/index.php/$1"
    )
}

When I try to open a blog post, it opens a page that seems to be a broken cake action. It loads the cake default view (header and footer), but there is nothing on the main part. Which means that it is calling a controller/action. If I turn on the debug Configure::write('debug', 2) to see what is happening, I get the following error:

Fatal error: Class ‘Debugger’ not found in /var/www/cake/libs/i18n.php on line 107

On any other part of the app the debugger works fine.

There are only two ways to access a WP post. Using the default WP permanent link settings (domain.tld/blog/?p=123) or setting the server.document-root="/var/www/app/webroot/blog/", but in this case the cakePHP app won’t be available.

Note: Everything works fine if I use Apache.

  • 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-27T03:24:22+00:00Added an answer on May 27, 2026 at 3:24 am

    I found the solution.

    Rewrite issue

    First, the rewrite. It is as simple as this:

    $HTTP["host"] =~ "domain.tld" {
    
        server.document-root = "/var/www/app/webroot/"
        url.rewrite-once = (
            "/(css|files|img|js|php)/(.*)" => "/$1/$2",
            "^/blog/(.*)$" => "/blog/index.php/$1",         // to take care of WP
            "^([^\?]*)(\?(.+))?$" => "/index.php?url=$1&$3" // to take care of cakePHP
        )
    }
    

    Class ‘Debugger’ issue

    Now, the Class ‘Debugger’ not found issue.

    1. chmod 777 /var/www/app/tmp/
    2. Remove any temp file from the same folder

    That is the basic that I’ve already done. But the problem was still there. So here is the trick. Proceed with the two steps explained above, and set the debug to zero (0). On /app/config/core.php

    Configure::write('debug', 0)
    

    Load any page or action. Then, change the debug to 1. Load the page again. Finally, change the debug to 2. Load the page and you won’t see that error anymore.

    Sounds crazy but it worked here. If I had set the debug to 2 on the first time I loaded the page, it would throw an error.

    If that does not work, you might want to try the solution that is mentioned on many sites. Add App::import('Core', 'Debugger') before the line that is causing the error. It didn’t work here, but many have said that it works.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I am writing an app with both english and french support. The app requests

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.