Project

General

Profile

[Solved] Permalinks issue with lighttpd and woocommerece

Added by austin.watling over 4 years ago

Good afternoon everyone,

I have narrowed my problem down to a permalink issue but have yet to be able to find the solution. We have a vps running debian and lighttpd (both up to date). Like most, the permalinks are set to /%postname%/ to make the url “pretty” and have the 404 error handler in the appropriate .conf file. Of course, this appears to break the woocommerece checkout page which I have tested by reverting the plain permalinks upon which the checkout page functions properly. I have come across a few different places where individuals had a similar problem but the server seemed to always be running ngix. Has anyone had a similar issue running lighttpd and, maybe, have any solutions or ideas? I would be eternally grateful!

Website: https://biomimicry.net/shop


Replies (2)

RE: Permalinks issue with lighttpd and woocommerece - Added by austin.watling over 4 years ago

In case anyone comes up against the same problem, here is how I solved it in the conf. Cheers!

url.rewrite-final = (
                # "^/blog/(.*)" => "/index.php/$1",
                # Exclude some directories from rewriting
                "^/(wp-admin|wp-includes)/?(.*)" => "$0",
                "^/(wp-admin|wp-includes)/(.*)" => "/wordpress/$0",

                # Exclude .php files at root from rewriting
                "^/(.*.php)(.*)$" => "$1$2",
                "^/(.*.php)" => "$0",

                # Handle permalinks and feeds
                "^/(.*)$" => "/index.php/$1" 
        )

RE: Permalinks issue with lighttpd and woocommerece - Added by gstrauss over 4 years ago

austin.watling: Thanks for the update. Please verify that your rules work for all your URLs. It appears that some of the rules you list are not likely ever triggered since the rule immediately prior will match instead.

Did you mean something like:

url.rewrite-final = (
  # "^/blog/(.*)" => "/index.php/$1",
  # Exclude some directories from rewriting
  "^/(?:wp-admin|wp-includes)(?:/.*)?" => "$0",
  # Exclude .php files at root from rewriting
  "^/[^/]+.php(?:/.*)?" => "$0",
  # Handle permalinks and feeds
  "^/(.*)$" => "/index.php/$1" 
)

    (1-2/2)