AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / unix / Perguntas / 553206
Accepted
Chris Stryczynski
Chris Stryczynski
Asked: 2019-11-21 09:17:30 +0800 CST2019-11-21 09:17:30 +0800 CST 2019-11-21 09:17:30 +0800 CST

Apache RewriteCond não corresponde em `REQUEST_FILENAME` mesmo que o arquivo exista?

  • 772

Registro de rastreamento:

apache_1    | [Wed Nov 20 17:14:43.950796 2019] [rewrite:trace2] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] init rewrite engine with requested uri /css/main.css
apache_1    | [Wed Nov 20 17:14:43.950822 2019] [rewrite:trace3] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] applying pattern '^' to uri '/css/main.css'
apache_1    | [Wed Nov 20 17:14:43.950836 2019] [rewrite:trace4] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] RewriteCond: input='/css/main.css' pattern='-f' => not-matched
apache_1    | [Wed Nov 20 17:14:43.950839 2019] [rewrite:trace3] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] applying pattern '^' to uri '/css/main.css'
apache_1    | [Wed Nov 20 17:14:43.950842 2019] [rewrite:trace2] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] rewrite '/css/main.css' -> '/index.php'
apache_1    | [Wed Nov 20 17:14:43.950845 2019] [rewrite:trace2] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] local path result: /index.php
apache_1    | [Wed Nov 20 17:14:43.950850 2019] [rewrite:trace2] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] prefixed with document_root to /var/www/html/public/index.php
apache_1    | [Wed Nov 20 17:14:43.950852 2019] [rewrite:trace1] [pid 9:tid 140252198749952] mod_rewrite.c(483): [client 172.18.0.1:54078] 172.18.0.1 - - [localhost/sid#7f8f031725e8][rid#7f8f0078a0a0/initial] go-ahead with /var/www/html/public/index.php [OK]

Bit importante é:

RewriteCond: input='/css/main.css' pattern='-f' => not-matched

Por que isso não está encontrando o arquivo? Definitivamente está lá.

A configuração tem:

    DocumentRoot /var/www/html/public/

E o arquivo está localizado em: /var/www/html/public/css/main.css.


Executando straceno apache, vejo o seguinte:

apache_1    | [pid    11] poll([{fd=9, events=POLLIN}], 1, 3000 <unfinished ...>
apache_1    | [pid    10] <... select resumed> )      = 0 (Timeout)
apache_1    | [pid    10] wait4(-1, 0x7ffd156f4e0c, WNOHANG|WSTOPPED, NULL) = 0
apache_1    | [pid    10] times({tms_utime=2, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 478112492
apache_1    | [pid    10] select(0, NULL, NULL, NULL, {tv_sec=1, tv_usec=0}) = 0 (Timeout)
apache_1    | [pid    10] wait4(-1, 0x7ffd156f4e0c, WNOHANG|WSTOPPED, NULL) = 0
apache_1    | [pid    10] times({tms_utime=2, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 478112592
apache_1    | [pid    10] select(0, NULL, NULL, NULL, {tv_sec=1, tv_usec=0}) = 0 (Timeout)
apache_1    | [pid    10] wait4(-1, 0x7ffd156f4e0c, WNOHANG|WSTOPPED, NULL) = 0
apache_1    | [pid    10] times({tms_utime=2, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 478112692
apache_1    | [pid    10] select(0, NULL, NULL, NULL, {tv_sec=1, tv_usec=0} <unfinished ...>
apache_1    | [pid    67] <... epoll_wait resumed> [{EPOLLIN, {u32=3893182512, u64=140578172780592}}], 52, -1) = 1
apache_1    | [pid    59] <... epoll_wait resumed> [{EPOLLIN, {u32=3893182512, u64=140578172780592}}], 52, -1) = 1
apache_1    | [pid    67] accept4(3,  <unfinished ...>
apache_1    | [pid    59] accept4(3,  <unfinished ...>
apache_1    | [pid    67] <... accept4 resumed> {sa_family=AF_INET, sin_port=htons(42176), sin_addr=inet_addr("172.18.0.1")}, [128->16], SOCK_CLOEXEC) = 16
apache_1    | [pid    59] <... accept4 resumed> 0x7fda85ffad30, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
apache_1    | [pid    67] futex(0x7fdae80d3160, FUTEX_WAKE_PRIVATE, 1) = 1
apache_1    | [pid    59] epoll_wait(13,  <unfinished ...>
apache_1    | [pid    67] epoll_wait(13,  <unfinished ...>
apache_1    | [pid    22] <... futex resumed> )       = 0
apache_1    | [pid    22] futex(0x7fdae80d30e8, FUTEX_WAKE_PRIVATE, 1) = 0
apache_1    | [pid    22] getsockname(16, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("172.18.0.3")}, [128->16]) = 0
apache_1    | [pid    22] fcntl(16, F_GETFL)          = 0x2 (flags O_RDWR)
php-main_1  | - -  20/Nov/2019:17:40:08 +0000 "GET /css/main.css" 200
apache_1    | [pid    22] fcntl(16, F_SETFL, O_RDWR|O_NONBLOCK) = 0
apache_1    | [pid    22] read(16, "GET /css/main.css HTTP/1.1\r\nHost"..., 8000) = 90
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] write(6, "[Wed Nov 20 17:40:08.966703 2019"..., 249[Wed Nov 20 17:40:08.966703 2019] [rewrite:trace2] [pid 13:tid 140578125055744] mod_rewrite.c(483): [client 172.18.0.1:42176] 172.18.0.1 - - [localhost/sid#7fdae7cfe5e8][rid#7fdae43100a0/initial] init rewrite engine with requested uri /css/main.css
apache_1    | ) = 249
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] write(6, "[Wed Nov 20 17:40:08.966779 2019"..., 240[Wed Nov 20 17:40:08.966779 2019] [rewrite:trace3] [pid 13:tid 140578125055744] mod_rewrite.c(483): [client 172.18.0.1:42176] 172.18.0.1 - - [localhost/sid#7fdae7cfe5e8][rid#7fdae43100a0/initial] applying pattern '^' to uri '/css/main.css'
apache_1    | ) = 240
apache_1    | [pid    22] stat("/css/main.css", 0x7fdae534f8d0) = -1 ENOENT (No such file or directory)
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] write(6, "[Wed Nov 20 17:40:08.966875 2019"..., 259[Wed Nov 20 17:40:08.966875 2019] [rewrite:trace4] [pid 13:tid 140578125055744] mod_rewrite.c(483): [client 172.18.0.1:42176] 172.18.0.1 - - [localhost/sid#7fdae7cfe5e8][rid#7fdae43100a0/initial] RewriteCond: input='/css/main.css' pattern='-f' => not-matched
apache_1    | ) = 259
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] write(6, "[Wed Nov 20 17:40:08.966925 2019"..., 240[Wed Nov 20 17:40:08.966925 2019] [rewrite:trace3] [pid 13:tid 140578125055744] mod_rewrite.c(483): [client 172.18.0.1:42176] 172.18.0.1 - - [localhost/sid#7fdae7cfe5e8][rid#7fdae43100a0/initial] applying pattern '^' to uri '/css/main.css'
apache_1    | ) = 240
apache_1    | [pid    22] getpid()                    = 13
apache_1    | [pid    22] write(6, "[Wed Nov 20 17:40:08.966980 2019"..., 236[Wed Nov 20 17:40:08.966980 2019] [rewrite:trace2] [pid 13:tid 140578125055744] mod_rewrite.c(483): [client 172.18.0.1:42176] 172.18.0.1 - - [localhost/sid#7fdae7cfe5e8][rid#7fdae43100a0/initial] rewrite '/css/main.css' -> '/index.php'

Editar

Por que o Apache está tentando ler /css/main.css?? Por que não está usando a raiz do documento lá

apache-httpd rewrite
  • 1 1 respostas
  • 301 Views

1 respostas

  • Voted
  1. Best Answer
    Chris Stryczynski
    2019-11-21T10:11:20+08:002019-11-21T10:11:20+08:00

    https://serverfault.com/questions/78125/mod-rewrite-request-filename-doesnt-contain-absolute-path

    REQUEST_FILENAMEparece retornar um valor diferente DEPENDENDO SE ESTÁ OU NÃO NO ApaChe ConFig ORRRR e .htaccess...

    • 0

relate perguntas

  • servidor httpd não compatível devido a cifras

  • Apache Logs - X-Forwarded-for juntamente com Virtualhost não registrando

  • Apache Common Document root , Diferentes hosts virtuais, Diferentes arquivos acessíveis

  • apache httpd especifica CipherSuite

  • SVN com erros de caminho de configuração do apache2

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Possível firmware ausente /lib/firmware/i915/* para o módulo i915

    • 3 respostas
  • Marko Smith

    Falha ao buscar o repositório de backports jessie

    • 4 respostas
  • Marko Smith

    Como exportar uma chave privada GPG e uma chave pública para um arquivo

    • 4 respostas
  • Marko Smith

    Como podemos executar um comando armazenado em uma variável?

    • 5 respostas
  • Marko Smith

    Como configurar o systemd-resolved e o systemd-networkd para usar o servidor DNS local para resolver domínios locais e o servidor DNS remoto para domínios remotos?

    • 3 respostas
  • Marko Smith

    apt-get update error no Kali Linux após a atualização do dist [duplicado]

    • 2 respostas
  • Marko Smith

    Como ver as últimas linhas x do log de serviço systemctl

    • 5 respostas
  • Marko Smith

    Nano - pule para o final do arquivo

    • 8 respostas
  • Marko Smith

    erro grub: você precisa carregar o kernel primeiro

    • 4 respostas
  • Marko Smith

    Como baixar o pacote não instalá-lo com o comando apt-get?

    • 7 respostas
  • Martin Hope
    user12345 Falha ao buscar o repositório de backports jessie 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl Por que a maioria dos exemplos do systemd contém WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky Como exportar uma chave privada GPG e uma chave pública para um arquivo 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll status systemctl mostra: "Estado: degradado" 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim Como podemos executar um comando armazenado em uma variável? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S Por que /dev/null é um arquivo? Por que sua função não é implementada como um programa simples? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 Como ver as últimas linhas x do log de serviço systemctl 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - pule para o final do arquivo 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla Por que verdadeiro e falso são tão grandes? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis Substitua a string em um arquivo de texto enorme (70 GB), uma linha 2017-12-30 06:58:33 +0800 CST

Hot tag

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve