Portál AbcLinuxu, 4. května 2025 23:02
location / { try_files $uri $uri/ /index.php$is_args$args; }Nebo v .htaccess pro apache je
RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]Pomuzete s prekonvertovanim pro lighttpd? Diky
magnet.attract-physical-path-to = ( server.document-root + "/rewrite.lua" )- do webrootu a souboru rewrite.lua vložit:
attr = lighty.stat(lighty.env["physical.path"]) if (not attr) then lighty.env["uri.path"] = "/index.php" lighty.env["physical.rel-path"] = lighty.env["uri.path"] lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"] end -- print ("final file is " .. lighty.env["physical.path"])
url.rewrite-once = ( "^(/[^\?]*)(\?.*)?" => "/index.php$1$2" ), ale nejak to nefunguje dle ocekavani.
url.redirect = () url.rewrite-if-not-file = ( "^/(css|img|js)/.*\.(jpg|jpeg|gif|png|swf|avi|mpg|mpeg|mp3|flv|ico|css|js)$" => "$0", "^/(favicon\.ico|robots\.txt|sitemap\.xml)$" => "$0", "^/[^\?]*(\?.*)?$" => "index.php/$1" ) server.document-root = "/var/www/localhost/htdocs/app/public"
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.