Probleme beim Umschreiben von URLs mit aktiviertem fcgid

Probleme beim Umschreiben von URLs mit aktiviertem fcgid

Zunächst einige Informationen zu meinem Server:

Apache2Version: 2.4 Module: php5: deaktiviert; umschreiben: ermöglicht; suexec: ermöglicht; fcgid: ermöglicht;

PHPVersion: 5.3.3

Ich erstelle derzeit eine Website mit CodeIgniter. Ich möchte meine URLs umschreiben, um die index.php vor dem Browser zu „verbergen“.

Ich habe diese beiden Lösungen hier bereits ausprobiert, aber es hat nicht funktioniert:http://takeitoffroad.blogspot.ch/2008/08/codeigniter-issues-with-htaccess-to.html

Meine .htaccess-Datei sieht derzeit folgendermaßen aus:

Bearbeiten: Ich habe das zum Laufen gebracht, wenn ich es in die Konfigurationsdatei meines vHosts einfüge, aber wenn ich es in .htaccess verwende, tut es nicht, was es sollte ... aktivierte Ablaufverfolgung, Protokoll unten:

<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]

Wenn ich die letzte Zeile (interne Weiterleitung) überprüfe, ist es genau die gleiche Zeile, als ob ich direkt zu /index.php/main/forgot navigieren würde, dann würde es funktionieren ... Ich würde sagen, es muss etwas mit FCGID zu tun haben

Ich würde mich über jede mögliche Lösung freuen. Wenn Sie weitere Informationen wünschen, schreiben Sie einfach einen Kommentar und ich werde ihn hinzufügen

Danke

Xavjer

Antwort1

Okay, habe eine Lösung gefunden. Ich weiß nicht genau, warum, aber das Hinzufügen eines Fragezeichens vor dem Schrägstrich in index.php/$1 funktioniert jetzt einwandfrei ... hat gestern allerdings nicht funktioniert O_o

<IfModule mod_rewrite.c>
    RewriteEngine On

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

Kann mir jemand erklären, warum es dort sein muss?

verwandte Informationen