Problemas com a reescrita de URLs com o fcgid ativado

Problemas com a reescrita de URLs com o fcgid ativado

Primeiro algumas informações sobre meu servidor:

Apache2Versão: 2.4 Módulos: php5: desabilitado; reescrever: habilitado; suexec: habilitado; fcgid: habilitado;

PHPVersão: 5.3.3

Atualmente estou criando um site usando CodeIgniter, gostaria de reescrever minhas URLs para 'ocultar' o index.php do navegador

Já tentei essas 2 soluções aqui mas não funcionou:http://takeitoffroad.blogspot.ch/2008/08/codeigniter-issues-with-htaccess-to.html

Meu arquivo .htaccess atualmente está assim:

Editar: fiz este funcionar, se eu colocar no meu arquivo conf do meu vHost, mas se eu usar no .htaccess ele não faz o que deveria ... rastreamento ativado, log abaixo:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>


[Wed May 22 09:42:18.665868 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1916d60/initial] [perdir /var/customers/webs/cust/sdom/domain/] add path info postfix: /var/customers/webs/cust/sdom/domain/main -> /var/customers/webs/cust/sdom/domain/main/forgot
[Wed May 22 09:42:18.665898 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1916d60/initial] [perdir /var/customers/webs/cust/sdom/domain/] strip per-dir prefix: /var/customers/webs/cust/sdom/domain/main/forgot -> main/forgot
[Wed May 22 09:42:18.665905 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1916d60/initial] [perdir /var/customers/webs/cust/sdom/domain/] applying pattern '^(.*)$' to uri 'main/forgot'
[Wed May 22 09:42:18.665924 2013] [rewrite:trace4] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1916d60/initial] [perdir /var/customers/webs/cust/sdom/domain/] RewriteCond: input='/var/customers/webs/cust/sdom/domain/main' pattern='!-f' => matched
[Wed May 22 09:42:18.665941 2013] [rewrite:trace4] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1916d60/initial] [perdir /var/customers/webs/cust/sdom/domain/] RewriteCond: input='/var/customers/webs/cust/sdom/domain/main' pattern='!-d' => matched
[Wed May 22 09:42:18.665949 2013] [rewrite:trace2] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1916d60/initial] [perdir /var/customers/webs/cust/sdom/domain/] rewrite 'main/forgot' -> 'index.php/main/forgot'
[Wed May 22 09:42:18.665972 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1916d60/initial] [perdir /var/customers/webs/cust/sdom/domain/] add per-dir prefix: index.php/main/forgot -> /var/customers/webs/cust/sdom/domain/index.php/main/forgot
[Wed May 22 09:42:18.665982 2013] [rewrite:trace2] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1916d60/initial] [perdir /var/customers/webs/cust/sdom/domain/] strip document_root prefix: /var/customers/webs/cust/sdom/domain/index.php/main/forgot -> /index.php/main/forgot
[Wed May 22 09:42:18.665988 2013] [rewrite:trace1] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1916d60/initial] [perdir /var/customers/webs/cust/sdom/domain/] internal redirect with /index.php/main/forgot [INTERNAL REDIRECT]
[Wed May 22 09:42:18.666041 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1926cc0/initial/redir#1] [perdir /var/customers/webs/cust/sdom/domain/] add path info postfix: /var/customers/webs/cust/sdom/domain/index.php -> /var/customers/webs/cust/sdom/domain/index.php/main/forgot
[Wed May 22 09:42:18.666052 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1926cc0/initial/redir#1] [perdir /var/customers/webs/cust/sdom/domain/] strip per-dir prefix: /var/customers/webs/cust/sdom/domain/index.php/main/forgot -> index.php/main/forgot
[Wed May 22 09:42:18.666058 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1926cc0/initial/redir#1] [perdir /var/customers/webs/cust/sdom/domain/] applying pattern '^(.*)$' to uri 'index.php/main/forgot'
[Wed May 22 09:42:18.666069 2013] [rewrite:trace4] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1926cc0/initial/redir#1] [perdir /var/customers/webs/cust/sdom/domain/] RewriteCond: input='/var/customers/webs/cust/sdom/domain/index.php' pattern='!-f' => not-matched
[Wed May 22 09:42:18.666076 2013] [rewrite:trace1] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c1926cc0/initial/redir#1] [perdir /var/customers/webs/cust/sdom/domain/] pass through /var/customers/webs/cust/sdom/domain/index.php
[Wed May 22 09:42:18.666130 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c191cd90/subreq] [perdir /var/customers/webs/cust/sdom/domain/] add path info postfix: /var/customers/webs/cust/sdom/domain/main -> /var/customers/webs/cust/sdom/domain/main/forgot
[Wed May 22 09:42:18.666149 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c191cd90/subreq] [perdir /var/customers/webs/cust/sdom/domain/] strip per-dir prefix: /var/customers/webs/cust/sdom/domain/main/forgot -> main/forgot
[Wed May 22 09:42:18.666156 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c191cd90/subreq] [perdir /var/customers/webs/cust/sdom/domain/] applying pattern '^(.*)$' to uri 'main/forgot'
[Wed May 22 09:42:18.666167 2013] [rewrite:trace4] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c191cd90/subreq] [perdir /var/customers/webs/cust/sdom/domain/] RewriteCond: input='/var/customers/webs/cust/sdom/domain/main' pattern='!-f' => matched
[Wed May 22 09:42:18.666184 2013] [rewrite:trace4] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c191cd90/subreq] [perdir /var/customers/webs/cust/sdom/domain/] RewriteCond: input='/var/customers/webs/cust/sdom/domain/main' pattern='!-d' => matched
[Wed May 22 09:42:18.666191 2013] [rewrite:trace2] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c191cd90/subreq] [perdir /var/customers/webs/cust/sdom/domain/] rewrite 'main/forgot' -> 'index.php/main/forgot'
[Wed May 22 09:42:18.666198 2013] [rewrite:trace3] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c191cd90/subreq] [perdir /var/customers/webs/cust/sdom/domain/] add per-dir prefix: index.php/main/forgot -> /var/customers/webs/cust/sdom/domain/index.php/main/forgot
[Wed May 22 09:42:18.666206 2013] [rewrite:trace2] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c191cd90/subreq] [perdir /var/customers/webs/cust/sdom/domain/] strip document_root prefix: /var/customers/webs/cust/sdom/domain/index.php/main/forgot -> /index.php/main/forgot
[Wed May 22 09:42:18.666212 2013] [rewrite:trace1] [pid 24571] mod_rewrite.c(466): [client 193.134.254.25:61594] 193.134.254.25 - - [domain.example.com/sid#7fc8c1882480][rid#7fc8c191cd90/subreq] [perdir /var/customers/webs/cust/sdom/domain/] internal redirect with /index.php/main/forgot [INTERNAL REDIRECT]

Se eu verificar a última linha (redirecionamento interno), é exatamente a mesma linha como se eu navegasse diretamente para /index.php/main/forgot, então funcionaria ... eu diria que deve ter algo para fazer com FCGID

Eu ficaria feliz com qualquer solução possível. Se você quiser mais informações, basta postar um comentário e eu adicionarei

Obrigado

Xavjer

Responder1

Ok, encontrei uma solução. não sei exatamente por que, mas adicionar um ponto de interrogação antes da barra em index.php/$1 está funcionando bem agora... não funcionou ontem, difícil O_o

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>

Alguém poderia me explicar por que tem que estar lá?

informação relacionada