.htaccess

smyle

Erfahrenes Mitglied
Hallo ich mache erstelle mit PHP links die so aussehen können:
Index.php?news=news oder Index.php?news usw…

Habe gelesen das man die ? durch / ersetzen kann.
Dafür müsste man im die Datei .htaccess erstellen und folgendes eingeben:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /Projekt1/management/index.php
RewriteRule ^([\w]+)/?([\w]+)? /projekt1/management/index.php?news=$1
</IfModule>

Wenn ich den letzten RewriteRule auskommentiere erhalte ich keine Fehlermeldung. Aber sonst erhalte ich folgenden Fehler:


Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, postmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
________________________________________
Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 Server at localhost Port 80



Habe in einem anderen Formu gelesen das man mit diesem Code überprüfen kann ob mod_rewrite aktiviert ist.
Code:
#RewriteEngine on
#RewriteRule ^(.*)$ http://www.google.com [R]

Dies hat funktioniert. Denn wenn man die meine index Datei aufgerufen hat, wurde man automatisch auf die Google Homepage weitergeleitet.

Weis jemand was ich vielleicht falsch mache?
Ich habe die Homepage lokal den ich brauche die neue Version von Xampp.

Wenn ich die PHP info anschaue sollte das mod_rewrite auch aktiviert sein:

Loaded Modules: core mod_win32 mpm_winnt http_core mod_so mod_actions mod_alias mod_asis mod_auth_basic mod_auth_digest mod_authn_default mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dav_lock mod_dir mod_env mod_headers mod_include mod_info mod_isapi mod_log_config mod_mime mod_negotiation mod_proxy mod_proxy_ajp mod_rewrite mod_setenvif mod_ssl mod_status mod_php5 mod_perl

 
Im Error. Log steht folgendes:
Code:
[Fri Nov 18 16:09:57 2011] [alert] [client 127.0.0.1] C:/xampp/htdocs/Projekt1/management/.htaccess: Invalid command 'ewriteRule', perhaps misspelled or defined by a module not included in the server configuration
[Fri Nov 18 16:10:25 2011] [alert] [client 127.0.0.1] C:/xampp/htdocs/Projekt1/management/.htaccess: Invalid command 'ewriteRule', perhaps misspelled or defined by a module not included in the server configuration
[Fri Nov 18 16:10:30 2011] [alert] [client 127.0.0.1] C:/xampp/htdocs/Projekt1/management/.htaccess: Invalid command 'ewriteRule', perhaps misspelled or defined by a module not included in the server configuration
[Fri Nov 18 16:10:36 2011] [alert] [client 127.0.0.1] C:/xampp/htdocs/Projekt1/management/.htaccess: Invalid command 'ewriteRule', perhaps misspelled or defined by a module not included in the server configuration
[Fri Nov 18 16:17:48 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/Projekt1/management/index.php-news
[Fri Nov 18 16:30:38 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/Projekt1/management/Projekt1
[Fri Nov 18 16:30:56 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:30:56 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:33:38 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:33:38 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:33:39 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:33:39 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:34:20 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:34:20 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:34:35 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:34:35 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:34:45 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:34:45 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:35:10 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:35:10 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:36:38 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:36:38 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:40:14 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:40:14 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:40:30 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:40:30 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:48:25 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:48:25 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:48:44 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:48:44 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:48:46 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:48:46 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:50:42 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:50:42 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:50:58 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:50:58 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:51:10 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:51:10 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:52:31 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:52:31 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:52:38 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:52:38 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:52:55 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:52:55 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:52:58 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:52:58 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:53:41 2011] [alert] [client 127.0.0.1] C:/xampp/htdocs/Projekt1/management/.htaccess: Invalid command '$', perhaps misspelled or defined by a module not included in the server configuration
[Fri Nov 18 16:53:51 2011] [alert] [client 127.0.0.1] C:/xampp/htdocs/Projekt1/management/.htaccess: Invalid command '$', perhaps misspelled or defined by a module not included in the server configuration
[Fri Nov 18 16:53:53 2011] [alert] [client 127.0.0.1] C:/xampp/htdocs/Projekt1/management/.htaccess: Invalid command '$', perhaps misspelled or defined by a module not included in the server configuration
[Fri Nov 18 16:56:12 2011] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Fri Nov 18 16:56:12 2011] [notice] Child 2852: Exit event signaled. Child process is ending.
[Fri Nov 18 16:56:13 2011] [notice] Child 2852: Released the start mutex
[Fri Nov 18 16:56:14 2011] [notice] Child 2852: All worker threads have exited.
[Fri Nov 18 16:56:14 2011] [notice] Child 2852: Child process is exiting
[Fri Nov 18 16:56:14 2011] [notice] Parent: Child process exited successfully.
[Fri Nov 18 16:56:18 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 18 16:56:18 2011] [notice] Digest: done
[Fri Nov 18 16:56:19 2011] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Fri Nov 18 16:56:19 2011] [notice] Server built: Sep 10 2011 11:34:11
[Fri Nov 18 16:56:19 2011] [notice] Parent: Created child process 4840
[Fri Nov 18 16:56:20 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 18 16:56:20 2011] [notice] Digest: done
[Fri Nov 18 16:56:21 2011] [notice] Child 4840: Child process is running
[Fri Nov 18 16:56:21 2011] [notice] Child 4840: Acquired the start mutex.
[Fri Nov 18 16:56:21 2011] [notice] Child 4840: Starting 150 worker threads.
[Fri Nov 18 16:56:21 2011] [notice] Child 4840: Starting thread to listen on port 443.
[Fri Nov 18 16:56:21 2011] [notice] Child 4840: Starting thread to listen on port 443.
[Fri Nov 18 16:56:21 2011] [notice] Child 4840: Starting thread to listen on port 80.
[Fri Nov 18 16:56:21 2011] [notice] Child 4840: Starting thread to listen on port 80.
[Fri Nov 18 16:56:37 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 16:56:37 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 17:06:39 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 18 17:06:39 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Beim http://www.generateit.net/mod-rewrite/ erhalte ich denn Vorschlag http://localhost/news.html wenn ich die Adresse http://localhost/projekt1/management/index.php?news=news eingebe.
Somit habe ich den generierten Code kopiert wie es in der Anleitung steht und in meiner htaccess eingefügt.
Hier der Code:
Code:
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /projekt1/management/index.php?news=$1 [L]
Nun erhalte ich zwar keine Fehlermeldung aber die URL wird trotzdem nicht als http://localhost/news.html angepasst.

Im Log File habe ich nun zusätzlich folgende Einträge:
Code:
[Mon Nov 21 07:55:03 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Nov 21 07:55:03 2011] [notice] Digest: done
[Mon Nov 21 07:55:04 2011] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Mon Nov 21 07:55:04 2011] [notice] Server built: Sep 10 2011 11:34:11
[Mon Nov 21 07:55:04 2011] [notice] Parent: Created child process 2588
[Mon Nov 21 07:55:05 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Nov 21 07:55:05 2011] [notice] Digest: done
[Mon Nov 21 07:55:06 2011] [notice] Child 2588: Child process is running
[Mon Nov 21 07:55:06 2011] [notice] Child 2588: Acquired the start mutex.
[Mon Nov 21 07:55:06 2011] [notice] Child 2588: Starting 150 worker threads.
[Mon Nov 21 07:55:06 2011] [notice] Child 2588: Starting thread to listen on port 443.
[Mon Nov 21 07:55:06 2011] [notice] Child 2588: Starting thread to listen on port 443.
[Mon Nov 21 07:55:06 2011] [notice] Child 2588: Starting thread to listen on port 80.
[Mon Nov 21 07:55:06 2011] [notice] Child 2588: Starting thread to listen on port 80.
[Mon Nov 21 08:30:11 2011] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Mon Nov 21 08:30:11 2011] [notice] Child 2588: Exit event signaled. Child process is ending.
[Mon Nov 21 08:30:12 2011] [notice] Child 2588: Released the start mutex
[Mon Nov 21 08:30:13 2011] [notice] Child 2588: All worker threads have exited.
[Mon Nov 21 08:30:13 2011] [notice] Child 2588: Child process is exiting
[Mon Nov 21 08:30:13 2011] [notice] Parent: Child process exited successfully.
[Mon Nov 21 08:30:16 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Nov 21 08:30:16 2011] [notice] Digest: done
[Mon Nov 21 08:30:17 2011] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Mon Nov 21 08:30:17 2011] [notice] Server built: Sep 10 2011 11:34:11
[Mon Nov 21 08:30:17 2011] [notice] Parent: Created child process 7156
[Mon Nov 21 08:30:17 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Nov 21 08:30:17 2011] [notice] Digest: done
[Mon Nov 21 08:30:18 2011] [notice] Child 7156: Child process is running
[Mon Nov 21 08:30:18 2011] [notice] Child 7156: Acquired the start mutex.
[Mon Nov 21 08:30:18 2011] [notice] Child 7156: Starting 150 worker threads.
[Mon Nov 21 08:30:18 2011] [notice] Child 7156: Starting thread to listen on port 443.
[Mon Nov 21 08:30:18 2011] [notice] Child 7156: Starting thread to listen on port 443.
[Mon Nov 21 08:30:18 2011] [notice] Child 7156: Starting thread to listen on port 80.
[Mon Nov 21 08:30:18 2011] [notice] Child 7156: Starting thread to listen on port 80.
[Mon Nov 21 08:35:22 2011] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Mon Nov 21 08:35:22 2011] [notice] Child 7156: Exit event signaled. Child process is ending.
[Mon Nov 21 08:35:23 2011] [notice] Child 7156: Released the start mutex
[Mon Nov 21 08:35:24 2011] [notice] Child 7156: All worker threads have exited.
[Mon Nov 21 08:35:24 2011] [notice] Child 7156: Child process is exiting
[Mon Nov 21 08:35:24 2011] [notice] Parent: Child process exited successfully.
[Mon Nov 21 08:35:26 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Nov 21 08:35:26 2011] [notice] Digest: done
[Mon Nov 21 08:35:26 2011] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Mon Nov 21 08:35:26 2011] [notice] Server built: Sep 10 2011 11:34:11
[Mon Nov 21 08:35:26 2011] [notice] Parent: Created child process 4928
[Mon Nov 21 08:35:27 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Nov 21 08:35:27 2011] [notice] Digest: done
[Mon Nov 21 08:35:28 2011] [notice] Child 4928: Child process is running
[Mon Nov 21 08:35:28 2011] [notice] Child 4928: Acquired the start mutex.
[Mon Nov 21 08:35:28 2011] [notice] Child 4928: Starting 150 worker threads.
[Mon Nov 21 08:35:28 2011] [notice] Child 4928: Starting thread to listen on port 443.
[Mon Nov 21 08:35:28 2011] [notice] Child 4928: Starting thread to listen on port 443.
[Mon Nov 21 08:35:28 2011] [notice] Child 4928: Starting thread to listen on port 80.
[Mon Nov 21 08:35:28 2011] [notice] Child 4928: Starting thread to listen on port 80.
[Mon Nov 21 08:36:23 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://localhost/projekt1/management/index.php
[Mon Nov 21 08:36:23 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://localhost/projekt1/management/index.php
[Mon Nov 21 08:36:30 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Mon Nov 21 08:36:30 2011] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Denn Apache Server habe ich nach der Änderung im htaccess auch neugestartet. Die .htaccess Datei befindet sich übrigens im Ordner http://localhost/projekt1/management/.

Ich habe die htaccess auch schon gelöscht und neu hin kopiert / erstellt.

Habt ihr noch eine Idee?

edit:
Habe es noch mit verschiedenen Generator versuch und die folgenden Code erhalten:
Code:
#RewriteEngine On
#RewriteRule ^([^/]*)\.html$ /projekt1/management/index.php?news=$1 [L]

#Options +FollowSymLinks
#RewriteEngine on
#RewriteRule Projekt(.*)\.htm$ /projekt1/management/index.php?news=$1

#Options +FollowSymLinks
#RewriteEngine on
#RewriteRule index/(.*)/(.*)/$ /projekt1/management/index.php?$1=$2


#Options +FollowSymLinks
#RewriteEngine on
#RewriteRule http://localhost/index/(.*)/(.*)/$ /projekt1/management/index.php?$1=$2

Keines davon hat ein Fehler gegeben. Jedoch hat auch keins funktioniert.

Gruss
Smyle
 
Zuletzt bearbeitet von einem Moderator:
Ja das weis ich schon. Natürlich hatte ich die # zum Testen herusgenommen.
Hat trotzdem nicht funktioniert.
 
Zuletzt bearbeitet:
Was davon hast Du nicht mehr auskommentiert? Zeig ein Beispiel was Du verwendet hast und was nicht ging.

Und: bist Du sicher, dass mod_rewrite auf deinem Server vorhanden ist?
 
Ok, lassen wir die erste Version mal Revue passieren:

Code:
RewriteRule .* /Projekt1/management/index.php
RewriteRule ^([\w]+)/?([\w]+)? /projekt1/management/index.php?news=$1

Hier erstellst du eine Regel für quasi alle Requests (.*) die auf index.php weiter leitet. Soweit so gut. Als nächstes erstellst du eine weitere Wild-Card-Regel, die ebenfalls auf index.php mit den GET-Parametern news=$1. Das schließt die vorige Rule mit ein, also auch die Weiterleitung auf index.php. Das dürfte deine Rekursion sein, die mod_rewrite auch folgerichtig anmeckert.

Du schreibst im ersten Post, das du Links hast, die

- index.php?news=news
- index.php?news

lauten können. Und was genau bezweckst du mit der Rewrite-Rule? Was macht dein PHP-Code mit den GET-Parametern genau?
 
Also mein PHP liest heraus ob es index.php?news nicht leer ist.
Wenn dies nicht leer ist dann includet er eine andere Datei. Das heisst, im Haupt Bereich werden die, in diesem Fall, News angezeigt.

Was ich aber zukünftig machen möchte ist zu überprüfen ob index.php?news=news ist. Daher die beiden Varianten.

Hier noch der Code abschnitt:
PHP:
				if(isset($_GET['account']))
				{ 	
				  echo "<div style='margin:10px;'>"; 			
					$x = 0;
					if(isset($_POST['img']))
					{
					 $x++;
					 include 'account/upload.php';
					 //include 'account/upload2.php';
					}
					else
					{
					 include'account/index.php';
					}
				  echo"</div>";		
				}				
				else if(isset($_GET['news']))
				{
				 include'news/index.php';
				}
				else
				{
				 echo "<div style='margin:10px;'>";
				 include'home/index.php';
				 echo "</div>";
				}

Ist indem fall der htaccess Code falsch?

Ich möchte mod_rewrite gebrauchen da das dann im Browser schöner aussieht und für die Suchmaschinen auch besser ist. Also so wurde mir das jedenfalls erklärt.

Ich habe noch disen Tutorial angeschaut: http://edrackham.com/apache/beginners-mod_rewrite-tutorial/

Habe nun folgende php Datei:

PHP:
    <a href="product.php?product_id=19">text</a>
    <a href="product/25/">text2</a>
    <a href="product/18/">text2</a>
    <a href="product/news/">text3</a>

    You are viewing product <?php echo $_REQUEST['product_id']; echo"<br>".$_GET['product_id']; ?>



Wenn ich den ersten Link wähle bleibt der Link im Browser so: http://localhost/projekte/test/product. ... duct_id=19
Wenn ich den zweiten Link wähle, sihet dier Link im Browser so aus: http://localhost/projekte/test/product/25/
Wenn ich, nachdem ich den zweiten Link gewählt habe denn dritten wähle funktioniert das lieder nicht, da der Link so aussieht: http://localhost/projekte/test/product/25/product/18/

Beim wählen des dritten Links sollte der zweite eigentlich überschrieben werden und nicht erweitert.
Wie funktioniert das?

Im htaccess sieht der Code so aus:


Code:
        Options +FollowSymLinks 
        Options +Indexes 
        RewriteEngine On
    RewriteRule ^product/([0-9]+)/$ product.php?product_id=$1 [NC,L]

Bitte helft mir, ich bin verzweifelt und weiss nicht weiter :(

Hallo Zäme

Ich konnte das nun folgendermassen lösen:
Code:
Options +FollowSymLinks 
Options +Indexes 
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /projekt1/management/loggedIn.php?$1=$2 [NC,L]

Das heisst ich habe beispielsweisen den Link home.html was eigentlich index.php?home=1 wäre.
Mit $_GET['home'] überprüfe ich ob etwas in der Variable home gesetzt ist. Also steht nun im Webbrowser anstelle von index.php?home einfach nur home.html.

Nun möchte ich jedoch zusätzlich folgenden Code:
Code:
RewriteRule ^([^/]*)\.html$ /projekt1/management/index.php?$1=$2 [NC,L]
Jedoch wenn ich mich in der index.php Datei bedfinde funktioniert das nicht. und wenn ich in der LoggedIn.php Datei befinde, funktioniert das.

Habe das noch folgendermassen versucht:
Code:
Options +FollowSymLinks 
Options +Indexes 
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{SCRIPT_FILENAME} !index\.php
RewriteRule ^([^/]*)\.html$ /projekte/projekt1/loggedIn.php?$1=$2  [NC,L]

RewriteCond %{SCRIPT_FILENAME} !loggedIn\.php
RewriteRule ^([^/]*)\.html$ /projekte/projekt1/index.php?$1=$2 [NC,L]

Kann mir hier niemand helfen?

Ist denn niemand da der eine idee zu meinem Problem hat? :(
 
Zuletzt bearbeitet von einem Moderator:
Mir scheint, Du hast einen Fehler in deinen Rewriteregeln.

Du hast in deinen regulären Ausdrücken nur eine Gruppe die als Ergebnis zwischengespeichert wird, greifst aber auf 2 zu:
RewriteRule ^([^/]*)\.html$ /projekte/projekt1/index.php?$1=$2 [NC,L]

Probieren kannst Du es ja mal in der Form:
Code:
RewriteRule ^([^/]*)\.html$ /projekte/projekt1/index.php?home=$1 [NC,L]
oder:
Code:
RewriteRule ^([^/]*)\.([^/]*)\.html$ /projekte/projekt1/index.php?$1=$2 [NC,L]

Gruß
 
Zuletzt bearbeitet von einem Moderator:
Zurück