404 when trying to shorten URLs for MediaWiki with Lighttpd404's in Wordpress when trying to access...

Use comma instead of & in table

How can I be pwned if I'm not registered on that site?

Is divide-by-zero a security vulnerability?

Find the next monthly expiration date

Is there a German word for “analytics”?

I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?

Borrowing Characters

As a new poet, where can I find help from a professional to judge my work?

Hacker Rank: Array left rotation

How would we write a misogynistic character without offending people?

Sometimes a banana is just a banana

How to add multiple differently colored borders around a node?

What is better: yes / no radio, or simple checkbox?

What are these green text/line displays shown during the livestream of Crew Dragon's approach to dock with the ISS?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

Non-Italian European mafias in USA?

When should a commit not be version tagged?

What type of postprocessing gives the effect of people standing out

It took me a lot of time to make this, pls like. (YouTube Comments #1)

How to deny access to SQL Server to certain login over SSMS, but allow over .Net SqlClient Data Provider

Make me a metasequence

CBP Reminds Travelers to Allow 72 Hours for ESTA. Why?

A "strange" unit radio astronomy

Whom do I have to contact for a ticket refund in case of denied boarding (in the EU)?



404 when trying to shorten URLs for MediaWiki with Lighttpd


404's in Wordpress when trying to access scriptsCommand line tool for MediaWiki?Useful extensions for MediaWikiLighttpd: Subdomains give an 404 ErrorLighttpd - rewrite request when 404 errornginx short urls for mediawikiPHP File Lister Sub Directory 404 Error on LighttpdHow to block urls that request for robots.txt in lighttpd?Configure mod_rewritte for two hosts in LighttpdMake Lighttpd return 404 for unused subdomains?













3















I'm absolutely new at this, so please bear with me. I installed MediaWiki on Lighttpd with no problems, except that when I try to follow up redwerks instructions on how to shorten the urls for MediaWiki on Lighttpd, I always get a very frustrating 404. This is what I did:



on lighttpd.conf:



## MediaWiki
url.rewrite-once = (
"^/wiki(/|$)" => "/w/index.php",
"^/$" => "/w/index.php",
)
url.rewrite-if-not-file = (
"^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2",
"^/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2&archived=1",
)


on LocalSettings.php:



$wgScriptPath = "/w";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;


Help is so appreciated, I might start crying soon.










share|improve this question





























    3















    I'm absolutely new at this, so please bear with me. I installed MediaWiki on Lighttpd with no problems, except that when I try to follow up redwerks instructions on how to shorten the urls for MediaWiki on Lighttpd, I always get a very frustrating 404. This is what I did:



    on lighttpd.conf:



    ## MediaWiki
    url.rewrite-once = (
    "^/wiki(/|$)" => "/w/index.php",
    "^/$" => "/w/index.php",
    )
    url.rewrite-if-not-file = (
    "^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2",
    "^/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2&archived=1",
    )


    on LocalSettings.php:



    $wgScriptPath = "/w";
    $wgScriptExtension = ".php";
    $wgArticlePath = "/wiki/$1";
    $wgUsePathInfo = true;


    Help is so appreciated, I might start crying soon.










    share|improve this question



























      3












      3








      3


      1






      I'm absolutely new at this, so please bear with me. I installed MediaWiki on Lighttpd with no problems, except that when I try to follow up redwerks instructions on how to shorten the urls for MediaWiki on Lighttpd, I always get a very frustrating 404. This is what I did:



      on lighttpd.conf:



      ## MediaWiki
      url.rewrite-once = (
      "^/wiki(/|$)" => "/w/index.php",
      "^/$" => "/w/index.php",
      )
      url.rewrite-if-not-file = (
      "^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2",
      "^/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2&archived=1",
      )


      on LocalSettings.php:



      $wgScriptPath = "/w";
      $wgScriptExtension = ".php";
      $wgArticlePath = "/wiki/$1";
      $wgUsePathInfo = true;


      Help is so appreciated, I might start crying soon.










      share|improve this question
















      I'm absolutely new at this, so please bear with me. I installed MediaWiki on Lighttpd with no problems, except that when I try to follow up redwerks instructions on how to shorten the urls for MediaWiki on Lighttpd, I always get a very frustrating 404. This is what I did:



      on lighttpd.conf:



      ## MediaWiki
      url.rewrite-once = (
      "^/wiki(/|$)" => "/w/index.php",
      "^/$" => "/w/index.php",
      )
      url.rewrite-if-not-file = (
      "^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2",
      "^/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2&archived=1",
      )


      on LocalSettings.php:



      $wgScriptPath = "/w";
      $wgScriptExtension = ".php";
      $wgArticlePath = "/wiki/$1";
      $wgUsePathInfo = true;


      Help is so appreciated, I might start crying soon.







      mod-rewrite lighttpd http-status-code-404 mediawiki






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 1 '16 at 6:25









      JakeGould

      3,2141836




      3,2141836










      asked Aug 19 '15 at 17:59









      MajestosoAlceMajestosoAlce

      161




      161






















          2 Answers
          2






          active

          oldest

          votes


















          1














          The crying-free method is using Redwerks' superb configuration generator.






          share|improve this answer

































            0














            Note: This attempt at an answer is a fail as well; it simply does not work. The official MediaWiki page on this exact topic states the following:




            Warning: This Short URL page contains bad advice on how to configure your server that could lead to some pages on your wiki not
            working and/or may cause you issues while upgrading.




            It goes onto suggest using the Redworks generator, but that still doesn’t seem to work. Also, the official MediaWiki page sends mixed messages on what might work. I did find this page on $wgUsePathInfo that states this interesting tidbit:




            Note: These often break when PHP is set up in CGI mode. PATH_INFO may be correct if cgi.fix_pathinfo is set, but then again it may not;
            lighttpd converts incoming path data to lowercase on systems with
            case-insensitive filesystems, and there have been reports of problems
            on Apache as well. To be safe we'll continue to keep it off by default
            in these instances.




            Haven’t tested this cgi.fix_pathinfo idea yet, but posting this here as a reference. If someone can post a canonical answer, please go ahead and do so! Feel free to copy my answer if needed! Just somehow let’s get this mishegas settled so.



            Rest of answer—that does not seem to work—follows below.





            The posted answer by Tgr is excellent, but if you look at the output of that generator via their default settings for Lighted version 1.5+, this is the output:



            ## MediaWiki
            url.rewrite-once = (
            "^/wiki(/|$)" => "/w/index.php",
            "^/$" => "/w/index.php",
            )

            # Protect against bug 28235 (ported from MediaWiki's .htaccess file)
            $HTTP["url"] =~ "^/w/images/" {
            $HTTP["querystring"] =~ ".[^\/:*?x22<>|%]+(#|?|$)" {
            access.deny-all = "enable"
            }
            }

            # Deny access to deleted images folder"
            $HTTP["url"] =~ "^/w/images/deleted(/|$)" {
            access.deny-all = "enable"
            }

            # Deny access to folders MediaWiki has a .htaccess deny in"
            $HTTP["url"] =~ "^/w/(cache|languages|maintenance|serialized)(/|$)" {
            access.deny-all = "enable"
            }

            # Just in case, hide .svn and .git too
            $HTTP["url"] =~ "/.(svn|git)(|$)" {
            access.deny-all = "enable"
            }

            # Hide any .htaccess files
            $HTTP["url"] =~ "(^|/).ht" {
            access.deny-all = "enable"
            }

            # Uncomment the following code if you wish to hide the installer/updater
            ## Deny access to the installer
            #$HTTP["url"] =~ "^/w/mw-config(/|$)" {
            # access.deny-all = "enable"
            #}


            Seeing that url.rewrite-once at the top is the same between the original poster’s config, one can assume the issue is this url.rewrite-if-not-file chunk:



            url.rewrite-if-not-file = (
            "^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2",
            "^/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2&archived=1",
            )


            So I would recommend simply setting the initial chunk of code for Lighted like this:



            url.rewrite-once = (
            "^/wiki(/|$)" => "/w/index.php",
            "^/$" => "/w/index.php",
            )


            And the settings for LocalSettings.php look fine as is:



            $wgScriptPath = "/w";
            $wgScriptExtension = ".php";
            $wgArticlePath = "/wiki/$1";
            $wgUsePathInfo = true;


            If you can get that working, then add in the other access.deny-all stuff to lock the install down and you should be good to go.



            But past any of that, the issue could be that the original posters path to an article is not /wiki/ and the relative path to the index.php file is not /w/index.php. It could be simply /index.php.



            Yes, this is confusing… But some ideas to help others attempting to achieve this goal.






            share|improve this answer

























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "2"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f715342%2f404-when-trying-to-shorten-urls-for-mediawiki-with-lighttpd%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              The crying-free method is using Redwerks' superb configuration generator.






              share|improve this answer






























                1














                The crying-free method is using Redwerks' superb configuration generator.






                share|improve this answer




























                  1












                  1








                  1







                  The crying-free method is using Redwerks' superb configuration generator.






                  share|improve this answer















                  The crying-free method is using Redwerks' superb configuration generator.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 6 hours ago









                  yagmoth555

                  12k31842




                  12k31842










                  answered Aug 23 '15 at 2:29









                  TgrTgr

                  256311




                  256311

























                      0














                      Note: This attempt at an answer is a fail as well; it simply does not work. The official MediaWiki page on this exact topic states the following:




                      Warning: This Short URL page contains bad advice on how to configure your server that could lead to some pages on your wiki not
                      working and/or may cause you issues while upgrading.




                      It goes onto suggest using the Redworks generator, but that still doesn’t seem to work. Also, the official MediaWiki page sends mixed messages on what might work. I did find this page on $wgUsePathInfo that states this interesting tidbit:




                      Note: These often break when PHP is set up in CGI mode. PATH_INFO may be correct if cgi.fix_pathinfo is set, but then again it may not;
                      lighttpd converts incoming path data to lowercase on systems with
                      case-insensitive filesystems, and there have been reports of problems
                      on Apache as well. To be safe we'll continue to keep it off by default
                      in these instances.




                      Haven’t tested this cgi.fix_pathinfo idea yet, but posting this here as a reference. If someone can post a canonical answer, please go ahead and do so! Feel free to copy my answer if needed! Just somehow let’s get this mishegas settled so.



                      Rest of answer—that does not seem to work—follows below.





                      The posted answer by Tgr is excellent, but if you look at the output of that generator via their default settings for Lighted version 1.5+, this is the output:



                      ## MediaWiki
                      url.rewrite-once = (
                      "^/wiki(/|$)" => "/w/index.php",
                      "^/$" => "/w/index.php",
                      )

                      # Protect against bug 28235 (ported from MediaWiki's .htaccess file)
                      $HTTP["url"] =~ "^/w/images/" {
                      $HTTP["querystring"] =~ ".[^\/:*?x22<>|%]+(#|?|$)" {
                      access.deny-all = "enable"
                      }
                      }

                      # Deny access to deleted images folder"
                      $HTTP["url"] =~ "^/w/images/deleted(/|$)" {
                      access.deny-all = "enable"
                      }

                      # Deny access to folders MediaWiki has a .htaccess deny in"
                      $HTTP["url"] =~ "^/w/(cache|languages|maintenance|serialized)(/|$)" {
                      access.deny-all = "enable"
                      }

                      # Just in case, hide .svn and .git too
                      $HTTP["url"] =~ "/.(svn|git)(|$)" {
                      access.deny-all = "enable"
                      }

                      # Hide any .htaccess files
                      $HTTP["url"] =~ "(^|/).ht" {
                      access.deny-all = "enable"
                      }

                      # Uncomment the following code if you wish to hide the installer/updater
                      ## Deny access to the installer
                      #$HTTP["url"] =~ "^/w/mw-config(/|$)" {
                      # access.deny-all = "enable"
                      #}


                      Seeing that url.rewrite-once at the top is the same between the original poster’s config, one can assume the issue is this url.rewrite-if-not-file chunk:



                      url.rewrite-if-not-file = (
                      "^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2",
                      "^/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2&archived=1",
                      )


                      So I would recommend simply setting the initial chunk of code for Lighted like this:



                      url.rewrite-once = (
                      "^/wiki(/|$)" => "/w/index.php",
                      "^/$" => "/w/index.php",
                      )


                      And the settings for LocalSettings.php look fine as is:



                      $wgScriptPath = "/w";
                      $wgScriptExtension = ".php";
                      $wgArticlePath = "/wiki/$1";
                      $wgUsePathInfo = true;


                      If you can get that working, then add in the other access.deny-all stuff to lock the install down and you should be good to go.



                      But past any of that, the issue could be that the original posters path to an article is not /wiki/ and the relative path to the index.php file is not /w/index.php. It could be simply /index.php.



                      Yes, this is confusing… But some ideas to help others attempting to achieve this goal.






                      share|improve this answer






























                        0














                        Note: This attempt at an answer is a fail as well; it simply does not work. The official MediaWiki page on this exact topic states the following:




                        Warning: This Short URL page contains bad advice on how to configure your server that could lead to some pages on your wiki not
                        working and/or may cause you issues while upgrading.




                        It goes onto suggest using the Redworks generator, but that still doesn’t seem to work. Also, the official MediaWiki page sends mixed messages on what might work. I did find this page on $wgUsePathInfo that states this interesting tidbit:




                        Note: These often break when PHP is set up in CGI mode. PATH_INFO may be correct if cgi.fix_pathinfo is set, but then again it may not;
                        lighttpd converts incoming path data to lowercase on systems with
                        case-insensitive filesystems, and there have been reports of problems
                        on Apache as well. To be safe we'll continue to keep it off by default
                        in these instances.




                        Haven’t tested this cgi.fix_pathinfo idea yet, but posting this here as a reference. If someone can post a canonical answer, please go ahead and do so! Feel free to copy my answer if needed! Just somehow let’s get this mishegas settled so.



                        Rest of answer—that does not seem to work—follows below.





                        The posted answer by Tgr is excellent, but if you look at the output of that generator via their default settings for Lighted version 1.5+, this is the output:



                        ## MediaWiki
                        url.rewrite-once = (
                        "^/wiki(/|$)" => "/w/index.php",
                        "^/$" => "/w/index.php",
                        )

                        # Protect against bug 28235 (ported from MediaWiki's .htaccess file)
                        $HTTP["url"] =~ "^/w/images/" {
                        $HTTP["querystring"] =~ ".[^\/:*?x22<>|%]+(#|?|$)" {
                        access.deny-all = "enable"
                        }
                        }

                        # Deny access to deleted images folder"
                        $HTTP["url"] =~ "^/w/images/deleted(/|$)" {
                        access.deny-all = "enable"
                        }

                        # Deny access to folders MediaWiki has a .htaccess deny in"
                        $HTTP["url"] =~ "^/w/(cache|languages|maintenance|serialized)(/|$)" {
                        access.deny-all = "enable"
                        }

                        # Just in case, hide .svn and .git too
                        $HTTP["url"] =~ "/.(svn|git)(|$)" {
                        access.deny-all = "enable"
                        }

                        # Hide any .htaccess files
                        $HTTP["url"] =~ "(^|/).ht" {
                        access.deny-all = "enable"
                        }

                        # Uncomment the following code if you wish to hide the installer/updater
                        ## Deny access to the installer
                        #$HTTP["url"] =~ "^/w/mw-config(/|$)" {
                        # access.deny-all = "enable"
                        #}


                        Seeing that url.rewrite-once at the top is the same between the original poster’s config, one can assume the issue is this url.rewrite-if-not-file chunk:



                        url.rewrite-if-not-file = (
                        "^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2",
                        "^/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2&archived=1",
                        )


                        So I would recommend simply setting the initial chunk of code for Lighted like this:



                        url.rewrite-once = (
                        "^/wiki(/|$)" => "/w/index.php",
                        "^/$" => "/w/index.php",
                        )


                        And the settings for LocalSettings.php look fine as is:



                        $wgScriptPath = "/w";
                        $wgScriptExtension = ".php";
                        $wgArticlePath = "/wiki/$1";
                        $wgUsePathInfo = true;


                        If you can get that working, then add in the other access.deny-all stuff to lock the install down and you should be good to go.



                        But past any of that, the issue could be that the original posters path to an article is not /wiki/ and the relative path to the index.php file is not /w/index.php. It could be simply /index.php.



                        Yes, this is confusing… But some ideas to help others attempting to achieve this goal.






                        share|improve this answer




























                          0












                          0








                          0







                          Note: This attempt at an answer is a fail as well; it simply does not work. The official MediaWiki page on this exact topic states the following:




                          Warning: This Short URL page contains bad advice on how to configure your server that could lead to some pages on your wiki not
                          working and/or may cause you issues while upgrading.




                          It goes onto suggest using the Redworks generator, but that still doesn’t seem to work. Also, the official MediaWiki page sends mixed messages on what might work. I did find this page on $wgUsePathInfo that states this interesting tidbit:




                          Note: These often break when PHP is set up in CGI mode. PATH_INFO may be correct if cgi.fix_pathinfo is set, but then again it may not;
                          lighttpd converts incoming path data to lowercase on systems with
                          case-insensitive filesystems, and there have been reports of problems
                          on Apache as well. To be safe we'll continue to keep it off by default
                          in these instances.




                          Haven’t tested this cgi.fix_pathinfo idea yet, but posting this here as a reference. If someone can post a canonical answer, please go ahead and do so! Feel free to copy my answer if needed! Just somehow let’s get this mishegas settled so.



                          Rest of answer—that does not seem to work—follows below.





                          The posted answer by Tgr is excellent, but if you look at the output of that generator via their default settings for Lighted version 1.5+, this is the output:



                          ## MediaWiki
                          url.rewrite-once = (
                          "^/wiki(/|$)" => "/w/index.php",
                          "^/$" => "/w/index.php",
                          )

                          # Protect against bug 28235 (ported from MediaWiki's .htaccess file)
                          $HTTP["url"] =~ "^/w/images/" {
                          $HTTP["querystring"] =~ ".[^\/:*?x22<>|%]+(#|?|$)" {
                          access.deny-all = "enable"
                          }
                          }

                          # Deny access to deleted images folder"
                          $HTTP["url"] =~ "^/w/images/deleted(/|$)" {
                          access.deny-all = "enable"
                          }

                          # Deny access to folders MediaWiki has a .htaccess deny in"
                          $HTTP["url"] =~ "^/w/(cache|languages|maintenance|serialized)(/|$)" {
                          access.deny-all = "enable"
                          }

                          # Just in case, hide .svn and .git too
                          $HTTP["url"] =~ "/.(svn|git)(|$)" {
                          access.deny-all = "enable"
                          }

                          # Hide any .htaccess files
                          $HTTP["url"] =~ "(^|/).ht" {
                          access.deny-all = "enable"
                          }

                          # Uncomment the following code if you wish to hide the installer/updater
                          ## Deny access to the installer
                          #$HTTP["url"] =~ "^/w/mw-config(/|$)" {
                          # access.deny-all = "enable"
                          #}


                          Seeing that url.rewrite-once at the top is the same between the original poster’s config, one can assume the issue is this url.rewrite-if-not-file chunk:



                          url.rewrite-if-not-file = (
                          "^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2",
                          "^/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2&archived=1",
                          )


                          So I would recommend simply setting the initial chunk of code for Lighted like this:



                          url.rewrite-once = (
                          "^/wiki(/|$)" => "/w/index.php",
                          "^/$" => "/w/index.php",
                          )


                          And the settings for LocalSettings.php look fine as is:



                          $wgScriptPath = "/w";
                          $wgScriptExtension = ".php";
                          $wgArticlePath = "/wiki/$1";
                          $wgUsePathInfo = true;


                          If you can get that working, then add in the other access.deny-all stuff to lock the install down and you should be good to go.



                          But past any of that, the issue could be that the original posters path to an article is not /wiki/ and the relative path to the index.php file is not /w/index.php. It could be simply /index.php.



                          Yes, this is confusing… But some ideas to help others attempting to achieve this goal.






                          share|improve this answer















                          Note: This attempt at an answer is a fail as well; it simply does not work. The official MediaWiki page on this exact topic states the following:




                          Warning: This Short URL page contains bad advice on how to configure your server that could lead to some pages on your wiki not
                          working and/or may cause you issues while upgrading.




                          It goes onto suggest using the Redworks generator, but that still doesn’t seem to work. Also, the official MediaWiki page sends mixed messages on what might work. I did find this page on $wgUsePathInfo that states this interesting tidbit:




                          Note: These often break when PHP is set up in CGI mode. PATH_INFO may be correct if cgi.fix_pathinfo is set, but then again it may not;
                          lighttpd converts incoming path data to lowercase on systems with
                          case-insensitive filesystems, and there have been reports of problems
                          on Apache as well. To be safe we'll continue to keep it off by default
                          in these instances.




                          Haven’t tested this cgi.fix_pathinfo idea yet, but posting this here as a reference. If someone can post a canonical answer, please go ahead and do so! Feel free to copy my answer if needed! Just somehow let’s get this mishegas settled so.



                          Rest of answer—that does not seem to work—follows below.





                          The posted answer by Tgr is excellent, but if you look at the output of that generator via their default settings for Lighted version 1.5+, this is the output:



                          ## MediaWiki
                          url.rewrite-once = (
                          "^/wiki(/|$)" => "/w/index.php",
                          "^/$" => "/w/index.php",
                          )

                          # Protect against bug 28235 (ported from MediaWiki's .htaccess file)
                          $HTTP["url"] =~ "^/w/images/" {
                          $HTTP["querystring"] =~ ".[^\/:*?x22<>|%]+(#|?|$)" {
                          access.deny-all = "enable"
                          }
                          }

                          # Deny access to deleted images folder"
                          $HTTP["url"] =~ "^/w/images/deleted(/|$)" {
                          access.deny-all = "enable"
                          }

                          # Deny access to folders MediaWiki has a .htaccess deny in"
                          $HTTP["url"] =~ "^/w/(cache|languages|maintenance|serialized)(/|$)" {
                          access.deny-all = "enable"
                          }

                          # Just in case, hide .svn and .git too
                          $HTTP["url"] =~ "/.(svn|git)(|$)" {
                          access.deny-all = "enable"
                          }

                          # Hide any .htaccess files
                          $HTTP["url"] =~ "(^|/).ht" {
                          access.deny-all = "enable"
                          }

                          # Uncomment the following code if you wish to hide the installer/updater
                          ## Deny access to the installer
                          #$HTTP["url"] =~ "^/w/mw-config(/|$)" {
                          # access.deny-all = "enable"
                          #}


                          Seeing that url.rewrite-once at the top is the same between the original poster’s config, one can assume the issue is this url.rewrite-if-not-file chunk:



                          url.rewrite-if-not-file = (
                          "^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2",
                          "^/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2&archived=1",
                          )


                          So I would recommend simply setting the initial chunk of code for Lighted like this:



                          url.rewrite-once = (
                          "^/wiki(/|$)" => "/w/index.php",
                          "^/$" => "/w/index.php",
                          )


                          And the settings for LocalSettings.php look fine as is:



                          $wgScriptPath = "/w";
                          $wgScriptExtension = ".php";
                          $wgArticlePath = "/wiki/$1";
                          $wgUsePathInfo = true;


                          If you can get that working, then add in the other access.deny-all stuff to lock the install down and you should be good to go.



                          But past any of that, the issue could be that the original posters path to an article is not /wiki/ and the relative path to the index.php file is not /w/index.php. It could be simply /index.php.



                          Yes, this is confusing… But some ideas to help others attempting to achieve this goal.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Apr 13 '17 at 12:14









                          Community

                          1




                          1










                          answered Aug 1 '16 at 6:33









                          JakeGouldJakeGould

                          3,2141836




                          3,2141836






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Server Fault!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f715342%2f404-when-trying-to-shorten-urls-for-mediawiki-with-lighttpd%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Фонтен-ла-Гаярд Зміст Демографія | Економіка | Посилання |...

                              Список ссавців Італії Природоохоронні статуси | Список |...

                              Маріан Котлеба Зміст Життєпис | Політичні погляди |...