Project

General

Profile

[Solved] WordPress - index.php Issue

Added by jfnor almost 5 years ago

Hello,

We used to run a WordPress powered intranet for a small company on a simple XAMPP server on an old Windows machine (Apache). Recently I've migrated everything across to a Ubuntu server, using lighttpd.

I exported the WordPress files, then imported them to the new intranet. Everything appears to be working fine, however every webpage has index.php in the URL (apart from in the wp-admin directory). This has caused broken links to occur. E.g. now pages look like: http://IP/intranet/index.php/my-page/

The files are stored: /var/www/html/intranet
People have always accessed the intranet via: IP/intranet

I'd like to leave IP as the root directory, as we may have other internal sites.

I've researched for a while trying to get things to work, here is the lighttpd config file:

server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_rewrite" 
)

url.rewrite = (
        "^/(.*)\.(.+)$" => "/$0",
        "^/(.+)/?$" => "/intranet/index.php$1",
        "^/intranet/(.+)/?$" => "/intranet/index.php/$1" 
)

server.document-root        = "/var/www/html" 
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log" 
server.pid-file             = "/var/run/lighttpd.pid" 
server.username             = "www-data" 
server.groupname            = "www-data" 
server.port                 = 80

index-file.names            = ( "index.php", "index.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/" 
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
## Use ipv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl" 
include_shell "/usr/share/lighttpd/include-conf-enabled.pl" 

This doesn't fix the issue, every page loads (still with index.php in the URL), apart from the homepage (IP/intranet/index.php) which returns a 404 error.

Any help much appreciated.


Replies (6)

RE: WordPress - index.php Issue - Added by gstrauss almost 5 years ago

include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

This likely includes quite a bit which you do not show, such as your vhost configuration. It is extremely difficult to suggest changes to your lighttpd config when you have not shared a (representative) complete configuration. Please attach the output of lighttpd -f /etc/lighttpd/lighttpd.conf -p, though please change any private information before posting. What version of lighttpd are you using? lighttpd -V What version of Ubuntu? (Please always post as much useful information as you can when asking questions. Configuration and version information are bare minimums for most questions.)

It sounds like you have two issues:
  1. display site via IP
  2. hide index.php in pretty URLs

Please start by taking a look at WordPress tutorials for hints, as others have doing similar things before you.
I have not tested this, but a quick internet search turned up:
https://wpquestions.com/Wordpress_on_Lighttpd/145
https://thecustomizewindows.com/2013/08/installing-wordpress-on-lighttpd-web-server/

RE: WordPress - index.php Issue - Added by jfnor almost 5 years ago

Hello,

Thanks for your response.

# lighttpd -f /etc/lighttpd/lighttpd.conf -p

config {
    var.PID                        = 9079
    var.CWD                        = "/home/user" 
    mimetype.assign                = (
        ".ez"          => "application/andrew-inset",
        ".anx"         => "application/annodex",
        ".atom"        => "application/atom+xml",
        ".atomcat"     => "application/atomcat+xml",
        ".atomsrv"     => "application/atomserv+xml",
        # 5
        ".lin"         => "application/bbolin",
        ".cu"          => "application/cu-seeme",
        ".davmount"    => "application/davmount+xml",
        ".dcm"         => "application/dicom",
        ".tsp"         => "application/dsptype",
        # 10
        ".es"          => "application/ecmascript",
        ".otf"         => "application/font-sfnt",
        ".ttf"         => "application/font-sfnt",
        ".pfr"         => "application/font-tdpfr",
        ".woff"        => "application/font-woff",
        # 15
        ".spl"         => "application/futuresplash",
        ".gz"          => "application/gzip",
        ".hta"         => "application/hta",
        ".jar"         => "application/java-archive",
        ".ser"         => "application/java-serialized-object",
        # 20
        ".class"       => "application/java-vm",
        ".js"          => "application/javascript",
        ".json"        => "application/json",
        ".m3g"         => "application/m3g",
        ".hqx"         => "application/mac-binhex40",
        # 25
        ".cpt"         => "application/mac-compactpro",
        ".nb"          => "application/mathematica",
        ".nbp"         => "application/mathematica",
        ".mbox"        => "application/mbox",
        ".mdb"         => "application/msaccess",
        # 30
        ".doc"         => "application/msword",
        ".dot"         => "application/msword",
        ".mxf"         => "application/mxf",
        ".bin"         => "application/octet-stream",
        ".deploy"      => "application/octet-stream",
        # 35
        ".msu"         => "application/octet-stream",
        ".msp"         => "application/octet-stream",
        ".oda"         => "application/oda",
        ".opf"         => "application/oebps-package+xml",
        ".ogx"         => "application/ogg",
        # 40
        ".one"         => "application/onenote",
        ".onetoc2"     => "application/onenote",
        ".onetmp"      => "application/onenote",
        ".onepkg"      => "application/onenote",
        ".pdf"         => "application/pdf",
        # 45
        ".pgp"         => "application/pgp-encrypted",
        ".key"         => "application/pgp-keys",
        ".sig"         => "application/pgp-signature",
        ".prf"         => "application/pics-rules",
        ".ps"          => "application/postscript",
        # 50
        ".ai"          => "application/postscript",
        ".eps"         => "application/postscript",
        ".epsi"        => "application/postscript",
        ".epsf"        => "application/postscript",
        ".eps2"        => "application/postscript",
        # 55
        ".eps3"        => "application/postscript",
        ".rar"         => "application/rar",
        ".rdf"         => "application/rdf+xml",
        ".rtf"         => "application/rtf",
        ".stl"         => "application/sla",
        # 60
        ".smi"         => "application/smil+xml",
        ".smil"        => "application/smil+xml",
        ".xhtml"       => "application/xhtml+xml",
        ".xht"         => "application/xhtml+xml",
        ".xml"         => "application/xml",
        # 65
        ".xsd"         => "application/xml",
        ".xsl"         => "application/xslt+xml",
        ".xslt"        => "application/xslt+xml",
        ".xspf"        => "application/xspf+xml",
        ".zip"         => "application/zip",
        # 70
        ".apk"         => "application/vnd.android.package-archive",
        ".cdy"         => "application/vnd.cinderella",
        ".deb"         => "application/vnd.debian.binary-package",
        ".ddeb"        => "application/vnd.debian.binary-package",
        ".udeb"        => "application/vnd.debian.binary-package",
        # 75
        ".sfd"         => "application/vnd.font-fontforge-sfd",
        ".kml"         => "application/vnd.google-earth.kml+xml",
        ".kmz"         => "application/vnd.google-earth.kmz",
        ".xul"         => "application/vnd.mozilla.xul+xml",
        ".xls"         => "application/vnd.ms-excel",
        # 80
        ".xlb"         => "application/vnd.ms-excel",
        ".xlt"         => "application/vnd.ms-excel",
        ".eot"         => "application/vnd.ms-fontobject",
        ".thmx"        => "application/vnd.ms-officetheme",
        ".cat"         => "application/vnd.ms-pki.seccat",
        # 85
        ".ppt"         => "application/vnd.ms-powerpoint",
        ".pps"         => "application/vnd.ms-powerpoint",
        ".odc"         => "application/vnd.oasis.opendocument.chart",
        ".odb"         => "application/vnd.oasis.opendocument.database",
        ".odf"         => "application/vnd.oasis.opendocument.formula",
        # 90
        ".odg"         => "application/vnd.oasis.opendocument.graphics",
        ".otg"         => "application/vnd.oasis.opendocument.graphics-template"                                                                                                                                                             ,
        ".odi"         => "application/vnd.oasis.opendocument.image",
        ".odp"         => "application/vnd.oasis.opendocument.presentation",
        ".otp"         => "application/vnd.oasis.opendocument.presentation-templ                                                                                                                                                             ate",
        # 95
        ".ods"         => "application/vnd.oasis.opendocument.spreadsheet",
        ".ots"         => "application/vnd.oasis.opendocument.spreadsheet-templa                                                                                                                                                             te",
        ".odt"         => "application/vnd.oasis.opendocument.text",
        ".odm"         => "application/vnd.oasis.opendocument.text-master",
        ".ott"         => "application/vnd.oasis.opendocument.text-template",
        # 100
        ".oth"         => "application/vnd.oasis.opendocument.text-web",
        ".pptx"        => "application/vnd.openxmlformats-officedocument.present                                                                                                                                                             ationml.presentation",
        ".sldx"        => "application/vnd.openxmlformats-officedocument.present                                                                                                                                                             ationml.slide",
        ".ppsx"        => "application/vnd.openxmlformats-officedocument.present                                                                                                                                                             ationml.slideshow",
        ".potx"        => "application/vnd.openxmlformats-officedocument.present                                                                                                                                                             ationml.template",
        # 105
        ".xlsx"        => "application/vnd.openxmlformats-officedocument.spreads                                                                                                                                                             heetml.sheet",
        ".xltx"        => "application/vnd.openxmlformats-officedocument.spreads                                                                                                                                                             heetml.template",
        ".docx"        => "application/vnd.openxmlformats-officedocument.wordpro                                                                                                                                                             cessingml.document",
        ".dotx"        => "application/vnd.openxmlformats-officedocument.wordpro                                                                                                                                                             cessingml.template",
        ".cod"         => "application/vnd.rim.cod",
        # 110
        ".mmf"         => "application/vnd.smaf",
        ".sdc"         => "application/vnd.stardivision.calc",
        ".sds"         => "application/vnd.stardivision.chart",
        ".sda"         => "application/vnd.stardivision.draw",
        ".sdd"         => "application/vnd.stardivision.impress",
        # 115
        ".sdf"         => "application/vnd.stardivision.math",
        ".sdw"         => "application/vnd.stardivision.writer",
        ".sgl"         => "application/vnd.stardivision.writer-global",
        ".sxc"         => "application/vnd.sun.xml.calc",
        ".stc"         => "application/vnd.sun.xml.calc.template",
        # 120
        ".sxd"         => "application/vnd.sun.xml.draw",
        ".std"         => "application/vnd.sun.xml.draw.template",
        ".sxi"         => "application/vnd.sun.xml.impress",
        ".sti"         => "application/vnd.sun.xml.impress.template",
        ".sxm"         => "application/vnd.sun.xml.math",
        # 125
        ".sxw"         => "application/vnd.sun.xml.writer",
        ".sxg"         => "application/vnd.sun.xml.writer.global",
        ".stw"         => "application/vnd.sun.xml.writer.template",
        ".sis"         => "application/vnd.symbian.install",
        ".cap"         => "application/vnd.tcpdump.pcap",
        # 130
        ".pcap"        => "application/vnd.tcpdump.pcap",
        ".vsd"         => "application/vnd.visio",
        ".vst"         => "application/vnd.visio",
        ".vsw"         => "application/vnd.visio",
        ".vss"         => "application/vnd.visio",
        # 135
        ".wbxml"       => "application/vnd.wap.wbxml",
        ".wmlc"        => "application/vnd.wap.wmlc",
        ".wmlsc"       => "application/vnd.wap.wmlscriptc",
        ".wpd"         => "application/vnd.wordperfect",
        ".wp5"         => "application/vnd.wordperfect5.1",
        # 140
        ".wk"          => "application/x-123",
        ".7z"          => "application/x-7z-compressed",
        ".abw"         => "application/x-abiword",
        ".dmg"         => "application/x-apple-diskimage",
        ".bcpio"       => "application/x-bcpio",
        # 145
        ".torrent"     => "application/x-bittorrent",
        ".cab"         => "application/x-cab",
        ".cbr"         => "application/x-cbr",
        ".cbz"         => "application/x-cbz",
        ".cdf"         => "application/x-cdf",
        # 150
        ".cda"         => "application/x-cdf",
        ".vcd"         => "application/x-cdlink",
        ".pgn"         => "application/x-chess-pgn",
        ".mph"         => "application/x-comsol",
        ".cpio"        => "application/x-cpio",
        # 155
        ".csh"         => "application/x-csh",
        ".dcr"         => "application/x-director",
        ".dir"         => "application/x-director",
        ".dxr"         => "application/x-director",
        ".dms"         => "application/x-dms",
        # 160
        ".wad"         => "application/x-doom",
        ".dvi"         => "application/x-dvi",
        ".pfa"         => "application/x-font",
        ".pfb"         => "application/x-font",
        ".gsf"         => "application/x-font",
        # 165
        ".mm"          => "application/x-freemind",
        ".gan"         => "application/x-ganttproject",
        ".gnumeric"    => "application/x-gnumeric",
        ".sgf"         => "application/x-go-sgf",
        ".gcf"         => "application/x-graphing-calculator",
        # 170
        ".gtar"        => "application/x-gtar",
        ".tgz"         => "application/x-gtar-compressed",
        ".taz"         => "application/x-gtar-compressed",
        ".hdf"         => "application/x-hdf",
        ".hwp"         => "application/x-hwp",
        # 175
        ".ica"         => "application/x-ica",
        ".info"        => "application/x-info",
        ".ins"         => "application/x-internet-signup",
        ".isp"         => "application/x-internet-signup",
        ".iii"         => "application/x-iphone",
        # 180
        ".iso"         => "application/x-iso9660-image",
        ".jam"         => "application/x-jam",
        ".jnlp"        => "application/x-java-jnlp-file",
        ".jmz"         => "application/x-jmol",
        ".chrt"        => "application/x-kchart",
        # 185
        ".kil"         => "application/x-killustrator",
        ".skp"         => "application/x-koan",
        ".skd"         => "application/x-koan",
        ".skt"         => "application/x-koan",
        ".skm"         => "application/x-koan",
        # 190
        ".kpr"         => "application/x-kpresenter",
        ".kpt"         => "application/x-kpresenter",
        ".ksp"         => "application/x-kspread",
        ".kwd"         => "application/x-kword",
        ".kwt"         => "application/x-kword",
        # 195
        ".latex"       => "application/x-latex",
        ".lha"         => "application/x-lha",
        ".lyx"         => "application/x-lyx",
        ".lzh"         => "application/x-lzh",
        ".lzx"         => "application/x-lzx",
        # 200
        ".frm"         => "application/x-maker",
        ".maker"       => "application/x-maker",
        ".frame"       => "application/x-maker",
        ".fm"          => "application/x-maker",
        ".fb"          => "application/x-maker",
        # 205
        ".book"        => "application/x-maker",
        ".fbdoc"       => "application/x-maker",
        ".mif"         => "application/x-mif",
        ".application" => "application/x-ms-application",
        ".manifest"    => "application/x-ms-manifest",
        # 210
        ".wmd"         => "application/x-ms-wmd",
        ".wmz"         => "application/x-ms-wmz",
        ".com"         => "application/x-msdos-program",
        ".exe"         => "application/x-msdos-program",
        ".bat"         => "application/x-msdos-program",
        # 215
        ".dll"         => "application/x-msdos-program",
        ".msi"         => "application/x-msi",
        ".nc"          => "application/x-netcdf",
        ".pac"         => "application/x-ns-proxy-autoconfig",
        ".nwc"         => "application/x-nwc",
        # 220
        ".o"           => "application/x-object",
        ".oza"         => "application/x-oz-application",
        ".p7r"         => "application/x-pkcs7-certreqresp",
        ".crl"         => "application/x-pkcs7-crl",
        ".pyc"         => "application/x-python-code",
        # 225
        ".pyo"         => "application/x-python-code",
        ".qgs"         => "application/x-qgis",
        ".shp"         => "application/x-qgis",
        ".shx"         => "application/x-qgis",
        ".qtl"         => "application/x-quicktimeplayer",
        # 230
        ".rdp"         => "application/x-rdp",
        ".rpm"         => "application/x-redhat-package-manager",
        ".rss"         => "application/x-rss+xml",
        ".rb"          => "application/x-ruby",
        ".sci"         => "application/x-scilab",
        # 235
        ".sce"         => "application/x-scilab",
        ".xcos"        => "application/x-scilab-xcos",
        ".sh"          => "application/x-sh",
        ".shar"        => "application/x-shar",
        ".swf"         => "application/x-shockwave-flash",
        # 240
        ".swfl"        => "application/x-shockwave-flash",
        ".scr"         => "application/x-silverlight",
        ".sql"         => "application/x-sql",
        ".sit"         => "application/x-stuffit",
        ".sitx"        => "application/x-stuffit",
        # 245
        ".sv4cpio"     => "application/x-sv4cpio",
        ".sv4crc"      => "application/x-sv4crc",
        ".tar"         => "application/x-tar",
        ".tcl"         => "application/x-tcl",
        ".gf"          => "application/x-tex-gf",
        # 250
        ".pk"          => "application/x-tex-pk",
        ".texinfo"     => "application/x-texinfo",
        ".texi"        => "application/x-texinfo",
        ".t"           => "application/x-troff",
        ".tr"          => "application/x-troff",
        # 255
        ".roff"        => "application/x-troff",
        ".man"         => "application/x-troff-man",
        ".me"          => "application/x-troff-me",
        ".ms"          => "application/x-troff-ms",
        ".ustar"       => "application/x-ustar",
        # 260
        ".src"         => "application/x-wais-source",
        ".wz"          => "application/x-wingz",
        ".crt"         => "application/x-x509-ca-cert",
        ".xcf"         => "application/x-xcf",
        ".fig"         => "application/x-xfig",
        # 265
        ".xpi"         => "application/x-xpinstall",
        ".xz"          => "application/x-xz",
        ".amr"         => "audio/amr",
        ".awb"         => "audio/amr-wb",
        ".axa"         => "audio/annodex",
        # 270
        ".au"          => "audio/basic",
        ".snd"         => "audio/basic",
        ".csd"         => "audio/csound",
        ".orc"         => "audio/csound",
        ".sco"         => "audio/csound",
        # 275
        ".flac"        => "audio/flac",
        ".mid"         => "audio/midi",
        ".midi"        => "audio/midi",
        ".kar"         => "audio/midi",
        ".mpga"        => "audio/mpeg",
        # 280
        ".mpega"       => "audio/mpeg",
        ".mp2"         => "audio/mpeg",
        ".mp3"         => "audio/mpeg",
        ".m4a"         => "audio/mpeg",
        ".m3u"         => "audio/mpegurl",
        # 285
        ".oga"         => "audio/ogg",
        ".ogg"         => "audio/ogg",
        ".opus"        => "audio/ogg",
        ".spx"         => "audio/ogg",
        ".sid"         => "audio/prs.sid",
        # 290
        ".aif"         => "audio/x-aiff",
        ".aiff"        => "audio/x-aiff",
        ".aifc"        => "audio/x-aiff",
        ".gsm"         => "audio/x-gsm",
        ".wma"         => "audio/x-ms-wma",
        # 295
        ".wax"         => "audio/x-ms-wax",
        ".ra"          => "audio/x-pn-realaudio",
        ".rm"          => "audio/x-pn-realaudio",
        ".ram"         => "audio/x-pn-realaudio",
        ".pls"         => "audio/x-scpls",
        # 300
        ".sd2"         => "audio/x-sd2",
        ".wav"         => "audio/x-wav",
        ".alc"         => "chemical/x-alchemy",
        ".cac"         => "chemical/x-cache",
        ".cache"       => "chemical/x-cache",
        # 305
        ".csf"         => "chemical/x-cache-csf",
        ".cbin"        => "chemical/x-cactvs-binary",
        ".cascii"      => "chemical/x-cactvs-binary",
        ".ctab"        => "chemical/x-cactvs-binary",
        ".cdx"         => "chemical/x-cdx",
        # 310
        ".cer"         => "chemical/x-cerius",
        ".c3d"         => "chemical/x-chem3d",
        ".chm"         => "chemical/x-chemdraw",
        ".cif"         => "chemical/x-cif",
        ".cmdf"        => "chemical/x-cmdf",
        # 315
        ".cml"         => "chemical/x-cml",
        ".cpa"         => "chemical/x-compass",
        ".bsd"         => "chemical/x-crossfire",
        ".csml"        => "chemical/x-csml",
        ".csm"         => "chemical/x-csml",
        # 320
        ".ctx"         => "chemical/x-ctx",
        ".cxf"         => "chemical/x-cxf",
        ".cef"         => "chemical/x-cxf",
        ".emb"         => "chemical/x-embl-dl-nucleotide",
        ".embl"        => "chemical/x-embl-dl-nucleotide",
        # 325
        ".spc"         => "chemical/x-galactic-spc",
        ".inp"         => "chemical/x-gamess-input",
        ".gam"         => "chemical/x-gamess-input",
        ".gamin"       => "chemical/x-gamess-input",
        ".fch"         => "chemical/x-gaussian-checkpoint",
        # 330
        ".fchk"        => "chemical/x-gaussian-checkpoint",
        ".cub"         => "chemical/x-gaussian-cube",
        ".gau"         => "chemical/x-gaussian-input",
        ".gjc"         => "chemical/x-gaussian-input",
        ".gjf"         => "chemical/x-gaussian-input",
        # 335
        ".gal"         => "chemical/x-gaussian-log",
        ".gcg"         => "chemical/x-gcg8-sequence",
        ".gen"         => "chemical/x-genbank",
        ".hin"         => "chemical/x-hin",
        ".istr"        => "chemical/x-isostar",
        # 340
        ".ist"         => "chemical/x-isostar",
        ".jdx"         => "chemical/x-jcamp-dx",
        ".dx"          => "chemical/x-jcamp-dx",
        ".kin"         => "chemical/x-kinemage",
        ".mcm"         => "chemical/x-macmolecule",
        # 345
        ".mmd"         => "chemical/x-macromodel-input",
        ".mmod"        => "chemical/x-macromodel-input",
        ".mol"         => "chemical/x-mdl-molfile",
        ".rd"          => "chemical/x-mdl-rdfile",
        ".rxn"         => "chemical/x-mdl-rxnfile",
        # 350
        ".sd"          => "chemical/x-mdl-sdfile",
        ".tgf"         => "chemical/x-mdl-tgf",
        ".mcif"        => "chemical/x-mmcif",
        ".mol2"        => "chemical/x-mol2",
        ".gpt"         => "chemical/x-mopac-graph",
        # 355
        ".mop"         => "chemical/x-mopac-input",
        ".mopcrt"      => "chemical/x-mopac-input",
        ".mpc"         => "chemical/x-mopac-input",
        ".zmt"         => "chemical/x-mopac-input",
        ".moo"         => "chemical/x-mopac-out",
        # 360
        ".mvb"         => "chemical/x-mopac-vib",
        ".asn"         => "chemical/x-ncbi-asn1",
        ".prt"         => "chemical/x-ncbi-asn1-ascii",
        ".ent"         => "chemical/x-ncbi-asn1-ascii",
        ".val"         => "chemical/x-ncbi-asn1-binary",
        # 365
        ".aso"         => "chemical/x-ncbi-asn1-binary",
        ".pdb"         => "chemical/x-pdb",
        ".ros"         => "chemical/x-rosdal",
        ".sw"          => "chemical/x-swissprot",
        ".vms"         => "chemical/x-vamas-iso14976",
        # 370
        ".vmd"         => "chemical/x-vmd",
        ".xtel"        => "chemical/x-xtel",
        ".xyz"         => "chemical/x-xyz",
        ".gif"         => "image/gif",
        ".ief"         => "image/ief",
        # 375
        ".jp2"         => "image/jp2",
        ".jpg2"        => "image/jp2",
        ".jpeg"        => "image/jpeg",
        ".jpg"         => "image/jpeg",
        ".jpe"         => "image/jpeg",
        # 380
        ".jpm"         => "image/jpm",
        ".jpx"         => "image/jpx",
        ".jpf"         => "image/jpx",
        ".pcx"         => "image/pcx",
        ".png"         => "image/png",
        # 385
        ".svg"         => "image/svg+xml",
        ".svgz"        => "image/svg+xml",
        ".tiff"        => "image/tiff",
        ".tif"         => "image/tiff",
        ".djvu"        => "image/vnd.djvu",
        # 390
        ".djv"         => "image/vnd.djvu",
        ".ico"         => "image/vnd.microsoft.icon",
        ".wbmp"        => "image/vnd.wap.wbmp",
        ".cr2"         => "image/x-canon-cr2",
        ".crw"         => "image/x-canon-crw",
        # 395
        ".ras"         => "image/x-cmu-raster",
        ".cdr"         => "image/x-coreldraw",
        ".pat"         => "image/x-coreldrawpattern",
        ".cdt"         => "image/x-coreldrawtemplate",
        ".erf"         => "image/x-epson-erf",
        # 400
        ".art"         => "image/x-jg",
        ".jng"         => "image/x-jng",
        ".bmp"         => "image/x-ms-bmp",
        ".nef"         => "image/x-nikon-nef",
        ".orf"         => "image/x-olympus-orf",
        # 405
        ".psd"         => "image/x-photoshop",
        ".pnm"         => "image/x-portable-anymap",
        ".pbm"         => "image/x-portable-bitmap",
        ".pgm"         => "image/x-portable-graymap",
        ".ppm"         => "image/x-portable-pixmap",
        # 410
        ".rgb"         => "image/x-rgb",
        ".xbm"         => "image/x-xbitmap",
        ".xpm"         => "image/x-xpixmap",
        ".xwd"         => "image/x-xwindowdump",
        ".eml"         => "message/rfc822",
        # 415
        ".igs"         => "model/iges",
        ".iges"        => "model/iges",
        ".msh"         => "model/mesh",
        ".mesh"        => "model/mesh",
        ".silo"        => "model/mesh",
        # 420
        ".wrl"         => "model/vrml",
        ".vrml"        => "model/vrml",
        ".x3dv"        => "model/x3d+vrml",
        ".x3d"         => "model/x3d+xml",
        ".x3db"        => "model/x3d+binary",
        # 425
        ".appcache"    => "text/cache-manifest",
        ".ics"         => "text/calendar",
        ".icz"         => "text/calendar",
        ".css"         => "text/css",
        ".csv"         => "text/csv",
        # 430
        ".323"         => "text/h323",
        ".html"        => "text/html",
        ".htm"         => "text/html",
        ".shtml"       => "text/html",
        ".uls"         => "text/iuls",
        # 435
        ".mml"         => "text/mathml",
        ".md"          => "text/markdown",
        ".markdown"    => "text/markdown",
        ".asc"         => "text/plain",
        ".txt"         => "text/plain",
        # 440
        ".text"        => "text/plain",
        ".pot"         => "text/plain",
        ".brf"         => "text/plain",
        ".srt"         => "text/plain",
        ".rtx"         => "text/richtext",
        # 445
        ".sct"         => "text/scriptlet",
        ".wsc"         => "text/scriptlet",
        ".tm"          => "text/texmacs",
        ".tsv"         => "text/tab-separated-values",
        ".ttl"         => "text/turtle",
        # 450
        ".vcf"         => "text/vcard",
        ".vcard"       => "text/vcard",
        ".jad"         => "text/vnd.sun.j2me.app-descriptor",
        ".wml"         => "text/vnd.wap.wml",
        ".wmls"        => "text/vnd.wap.wmlscript",
        # 455
        ".bib"         => "text/x-bibtex",
        ".boo"         => "text/x-boo",
        ".h++"         => "text/x-c++hdr",
        ".hpp"         => "text/x-c++hdr",
        ".hxx"         => "text/x-c++hdr",
        # 460
        ".hh"          => "text/x-c++hdr",
        ".c++"         => "text/x-c++src",
        ".cpp"         => "text/x-c++src",
        ".cxx"         => "text/x-c++src",
        ".cc"          => "text/x-c++src",
        # 465
        ".h"           => "text/x-chdr",
        ".htc"         => "text/x-component",
        ".c"           => "text/x-csrc",
        ".d"           => "text/x-dsrc",
        ".diff"        => "text/x-diff",
        # 470
        ".patch"       => "text/x-diff",
        ".hs"          => "text/x-haskell",
        ".java"        => "text/x-java",
        ".ly"          => "text/x-lilypond",
        ".lhs"         => "text/x-literate-haskell",
        # 475
        ".moc"         => "text/x-moc",
        ".p"           => "text/x-pascal",
        ".pas"         => "text/x-pascal",
        ".gcd"         => "text/x-pcs-gcd",
        ".pl"          => "text/x-perl",
        # 480
        ".pm"          => "text/x-perl",
        ".py"          => "text/x-python",
        ".scala"       => "text/x-scala",
        ".etx"         => "text/x-setext",
        ".sfv"         => "text/x-sfv",
        # 485
        ".tk"          => "text/x-tcl",
        ".tex"         => "text/x-tex",
        ".ltx"         => "text/x-tex",
        ".sty"         => "text/x-tex",
        ".cls"         => "text/x-tex",
        # 490
        ".vcs"         => "text/x-vcalendar",
        ".3gp"         => "video/3gpp",
        ".axv"         => "video/annodex",
        ".dl"          => "video/dl",
        ".dif"         => "video/dv",
        # 495
        ".dv"          => "video/dv",
        ".fli"         => "video/fli",
        ".gl"          => "video/gl",
        ".mpeg"        => "video/mpeg",
        ".mpg"         => "video/mpeg",
        # 500
        ".mpe"         => "video/mpeg",
        ".mp4"         => "video/mp4",
        ".qt"          => "video/quicktime",
        ".mov"         => "video/quicktime",
        ".ogv"         => "video/ogg",
        # 505
        ".webm"        => "video/webm",
        ".mxu"         => "video/vnd.mpegurl",
        ".flv"         => "video/x-flv",
        ".lsf"         => "video/x-la-asf",
        ".lsx"         => "video/x-la-asf",
        # 510
        ".mng"         => "video/x-mng",
        ".asf"         => "video/x-ms-asf",
        ".asx"         => "video/x-ms-asf",
        ".wm"          => "video/x-ms-wm",
        ".wmv"         => "video/x-ms-wmv",
        # 515
        ".wmx"         => "video/x-ms-wmx",
        ".wvx"         => "video/x-ms-wvx",
        ".avi"         => "video/x-msvideo",
        ".movie"       => "video/x-sgi-movie",
        ".mpv"         => "video/x-matroska",
        # 520
        ".mkv"         => "video/x-matroska",
        ".ice"         => "x-conference/x-cooltalk",
        ".sisx"        => "x-epoc/x-sisx-app",
        ".vrm"         => "x-world/x-vrml",
        # 524
    )
    server.document-root           = "/var/www/html" 
    server.upload-dirs             = ("/var/cache/lighttpd/uploads")
    server.errorlog                = "/var/log/lighttpd/error.log" 
    server.pid-file                = "/var/run/lighttpd.pid" 
    server.username                = "www-data" 
    server.groupname               = "www-data" 
    server.port                    = 80
    index-file.names               = ("index.php", "index.html")
    url.access-deny                = ("~", ".inc")
    static-file.exclude-extensions = (".php", ".pl", ".fcgi")
    compress.cache-dir             = "/var/cache/lighttpd/compress/" 
    compress.filetype              = ("application/javascript", "text/css", "tex                                                                                                                                                             t/html", "text/plain")
    server.modules                 = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_rewrite",
        "mod_fastcgi",
        "mod_simple_vhost",
        # 7
    )
    simple-vhost.server-root       = "/srv" 
    simple-vhost.document-root     = "htdocs" 
    simple-vhost.default-host      = "www.example.com" 
    fastcgi.server                 = (
        ".php" => (
            (
                "bin-path"              => "/usr/bin/php-cgi",
                "socket"                => "/var/run/lighttpd/php.socket",
                "max-procs"             => 1,
                "bin-environment"       => (
                    "PHP_FCGI_CHILDREN"     => "4",
                    "PHP_FCGI_MAX_REQUESTS" => "10000",
                    # 2
                ),
                "bin-copy-environment"  => ("PATH", "SHELL", "USER"),
                # 5
                "broken-scriptfilename" => "enable",
                # 6
            ),
        ),
    )

}
# lighttpd -V

lighttpd/1.4.45 (ssl) - a light and fast webserver
Build-Date: Feb  6 2018 12:41:51

I'm using Ubuntu 18.04.

RE: WordPress - index.php Issue - Added by gstrauss almost 5 years ago

Please see the links I provided and then ask more specific questions.

RE: WordPress - index.php Issue - Added by jfnor almost 5 years ago

I've followed the first link you posted (read both of them), which contains a potential fix in the config file. Unfortunately I've already tried doing this/other combinations of url.rewrite I've read.

I've enabled mod_rewrite. The following is appended to the conf file.

var.app = "IP" 

url.rewrite = (
"^/?$" => "/intranet/index.php",
"^/intranet/(wp-.+)$" => "$0",
"^/intranet/xmlrpc.php" => "$0",
"^/intranet/sitemap.xml" => "$0",
"^/intranet/(.+)/?$" => "/intranet/index.php/$1" 
)

Unfortunately index.php is still showing in the URLs (http://IP/intranet/index.php/test-page) instead of http://IP/intranet/test-page as was with Apache. Does this config look incorrect (nothing else has changed in the config from my OP apart from the url.rewrite section)?

RE: WordPress - index.php Issue - Added by nitrox almost 5 years ago

Save the following to wp-rewrite.lua

if (not lighty.stat(lighty.env["physical.path"])) then
    lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. "index.php" 
 end

var.app = "IP"
magnet.attract-physical-path-to = ( "<path-to>/wp-rewrite.lua" )

#experiment with expire settings for caching
#expire.url = ( "/wp-content/themes/" => "access 1 weeks", "/wp-includes/js/" => "access 1 weeks", "/wp-content/uploads/" => "access 1 weeks" )

url.rewrite = (
"^/?$" => "/intranet/index.php",
"^/intranet/(wp-.+)$" => "$0",
"^/intranet/xmlrpc.php" => "$0",
"^/intranet/sitemap.xml" => "$0",
"^/intranet/(.+)/?$" => "/intranet/index.php/$1"
)

RE: [Solved] WordPress - index.php Issue - Added by jfnor almost 5 years ago

The above worked, thanks.

    (1-6/6)