mod_rewrite

Bash, Shell, PHP, Python, Perl, CGI
in flames
Posts: 70
Joined: 2003-12-24 22:33

mod_rewrite

Post by in flames » 2006-12-16 22:00

Guten Abend,

ich habe heute meinen Server neu aufgesetzt, leider funktioniert bei mir der mod_rewrite nicht.

In der apache.conf steht folgendes
<Directory /srv/www/*/web>
Options +Includes -Indexes +FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All
AllowOverride Indexes AuthConfig Limit FileInfo
Order allow,deny
Allow from all
<Files ~ "^.ht">
Deny from all
</Files>
</Directory>
aus der apache log ist nicht viel zu entnehmen
[16/Dec/2006:21:58:05 +0100] "GET / HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
evtl. gibt das HTTP/1.1" 200 irgendeine auskunft, ohne FollowSystemLink wird nämlich statt der weißen Seite 403 angezeigt

Im error log steht folgendes:
[Sat Dec 16 21:59:13 2006] [error] an unknown filter was not added: PHP
Hier ist mal mein phpinfo: http://www.bm-community.de/info.php


Wenn ich die Seite aufrufe erscheint lediglich eine weiße Seite.

Kann mir da jemand helfen?

Vielen Dank

lucki2
Posts: 427
Joined: 2006-10-03 01:31

Re: mod_rewrite

Post by lucki2 » 2006-12-17 06:20

[Sat Dec 16 21:59:13 2006] [error] an unknown filter was not added: PHP
Du hast imho eine alte Config für einen neuen apache2. Ändere das, wenn Du Zeit hast. PHP läuft, wie an der info zu sehen ist.

Dann war da noch was mit mod_rewrite -oder? Das hat damit recht wenig zu tun. Leider hast Du dazu keine Informationen gegeben. Ist das Modul geladen. Wo stehen die Regeln? Woran merkst du, dass es nicht funktioniert? Wie sollte es nach deinen Vorstellungen funktionieren?(weiße Seite ist mir bzgl mod_rewrite deutlich zu wenig um zu raten)


evtl. gibt das HTTP/1.1" 200 irgendeine auskunft
ja: Seite erfolgreich ausgeliefert.



In der Directory Sektion ist ein bischen was doppelt gemoppelt- was ich mal darauf zurückführe, daß du versucht hast das zum laufen zu bringen - sollte nicht stören.

Warum die Seite selber weiß bleibt - bleibt damit noch immer im Dunkeln.

Wo ist denn die Dokumentroot?

in flames
Posts: 70
Joined: 2003-12-24 22:33

Re: mod_rewrite

Post by in flames » 2006-12-17 09:13

Guten Morgen,

die Einträge waren von ISPConfig so vorgegeben, ich habe lediglich FollowSystemLinks hinzugefügt, das hat dazu geführt das eben nur noch eine weiße Seite kommt statt dem Fehler 404.

Hier ist mal die Regel (hat aber bisher immer auf anderen Servern funktioniert:

Ich hab jetzt mal ein Update auf 5.2.0 gemacht, nichtmal das bringt was
#Turn on Rewrite engine
RewriteEngine on

<files archiv>
ForceType application/x-httpd-php
#AcceptPathInfo On # uncomment this if you have apache2
</files>

#DirectoryIndex index.html index.htm umzug.php start.php portal.php index.php
ErrorDocument 404 /search404.php

DirectoryIndex index.html portal.php index.php index.htm

RewriteCond %{HTTP_HOST} !^www.bm-community.de
RewriteRule (.*) http://www.bm-community.de%{REQUEST_URI} [R=301,L]


#security
RewriteCond %{HTTP_REFERER} ^.*$
RewriteRule ^.*%27.*$ http://www.bm-community.de/ [redirect,last]
RewriteRule ^.*%25.*$ http://www.bm-community.de/ [redirect,last]
RewriteRule ^.*rush=.*$ http://www.bm-community.de/ [redirect,last]
RewriteRule ^.*echr.*$ http://www.bm-community.de/ [redirect,last]
RewriteRule ^.*esystem.*$ http://www.bm-community.de/ [redirect,last]
RewriteRule ^.*wget.*$ http://www.bm-community.de/ [redirect,last]

# prevent pre php 4.3.10 bug
RewriteCond %{HTTP_COOKIE}% s:(.*):%22test1%22%3b
RewriteRule ^.*$ http://www.bm-community.de/ [R,L]

# prevent perl user agent (most often used by santy)
RewriteCond %{HTTP_USER_AGENT} ^lwp.* [NC]
RewriteRule ^.*$ http://www.bm-community.de/ [R,L]
RewriteCond %{HTTP_REFERER} ^.*$

###

# View Category
RewriteCond %{REQUEST_URI} ^/vcat,([0-9]*).htm*
RewriteRule ^(.*) /index.php?c=%1 [L]

# View Forum
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),-(.*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([0-9]*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([0-9]*),-(.*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2 [L]

RewriteCond %{REQUEST_URI} ^/pforum,([0-9]*),([0-9]*),([0-9]*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&topicdays=%2&start=%3 [L]

# View Forum
RewriteCond %{REQUEST_URI} ^/mforum,([0-9]*),([a-zA-Z0-9]*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&mark=%2 [L]

# View Topic -- after first page
RewriteCond %{REQUEST_URI} ^/ltopic,([0-9]*),([0-9]*),([a-zA-Z0-9]*),([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&start=%4 [L]

# View Topic -- after first page
#lhtopic,426,0,asc,%FCber%2A,0.html #viewtopic.php?t=426&postdays=0&postorder=asc&highlight=%FCber%2A&start=15
#lhtopic,426,0,0,asc,%FCber%2A.html #viewtopic.php?t=426&start=0&postdays=0&postorder=asc&highlight=%FCber%2A
#lhtopic,568,0,0,asc,setbm=true.html #viewtopic.php?t=568&start=0&postdays=0&postorder=asc&highlight=&setbm=true
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9]*),([a-z]*),(.*),([0-9?]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&highlight=%4&start=%5 [L]
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9?]*),([0-9]*),([a-z]*),(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%3&postorder=%4&highlight=%5&start=%2 [L]
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9?]*),([0-9]*),([a-z]*),(.*),([a-z]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%3&postorder=%4&highlight=%5&start=%2&setbm=%6 [L]

# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/stopic,([0-9]*),([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1#%2 [L]

# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/htopic,([0-9]*),([^,]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&highlight=%2 [L]
RewriteCond %{REQUEST_URI} ^/htopic,([0-9]*),([0-9]*),([^,]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&highlight=%3 [L]

# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/vtopic,([0-9]*),([a-zA-Z0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&view=%2 [L]

# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/ptopic,([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1#%2 [L]
RewriteCond %{REQUEST_URI} ^/ptopic,([0-9]*),([^,]*).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1&highlight=%2#%3 [L]

# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),-(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([0-9]*),-(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2 [L]

#vote result
RewriteCond %{REQUEST_URI} ^/utopic,([0-9]*),([0-9]*),([a-zA-Z0-9]*),([a-zA-Z0-9]*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&vote=%4 [L]


#with session
#############

# View Forum
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&sid=%2 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2&sid=%3 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([a-fA-F0-9]{32}),-(.*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&sid=%2 [L]
RewriteCond %{REQUEST_URI} ^/forum,([0-9]*),([0-9]*),([a-fA-F0-9]{32}),-(.*).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&start=%2&sid=%3 [L]

RewriteCond %{REQUEST_URI} ^/pforum,([0-9]*),([0-9]*),([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&topicdays=%2&start=%3&sid=%4 [L]

# View Forum
RewriteCond %{REQUEST_URI} ^/mforum,([0-9]*),([a-zA-Z0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewforum.php?f=%1&mark=%2&sid=%3 [L]

# View Topic -- after first page
RewriteCond %{REQUEST_URI} ^/ltopic,([0-9]*),([0-9]*),([a-zA-Z0-9]*),([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&start=%4&sid=%5 [L]

# View Topic -- after first page
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9]*),([a-z]*),([^,]*),([0-9?]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&highlight=%4&start=%5&sid=%6 [L]
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9?]*),([0-9]*),([a-z]*),([^,]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%3&postorder=%4&highlight=%5&start=%2&sid=%6 [L]
RewriteCond %{REQUEST_URI} ^/lhtopic,([0-9]*),([0-9?]*),([0-9]*),([a-z]*),(.*),([a-z]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%3&postorder=%4&highlight=%5&start=%2&setbm=%6&sid=%7 [L]

# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/stopic,([0-9]*),([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1&sid=%2#%3 [L]

# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/htopic,([0-9]*),([^,]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&highlight=%2&sid=%3 [L]
RewriteCond %{REQUEST_URI} ^/htopic,([0-9]*),([0-9]*),([^,]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&highlight=%3&sid=%4 [L]

# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/vtopic,([0-9]*),([a-zA-Z0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&view=%2&sid=%3 [L]

# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/ptopic,([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1&sid=%2#%3 [L]
RewriteCond %{REQUEST_URI} ^/ptopic,([0-9]*),([^,]*),([[a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?p=%1&highlight=%2&sid=%3#%4 [L]

# View Topic -- normal
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&sid=%2 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([a-fA-F0-9]{32}),-(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&sid=%2 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&sid=%3 [L]
RewriteCond %{REQUEST_URI} ^/topic,([0-9]*),([0-9]*),([a-zA-Z0-9]*),-(.*).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&start=%2&sid=%3 [L]

#vote result
RewriteCond %{REQUEST_URI} ^/utopic,([0-9]*),([0-9]*),([a-zA-Z0-9]*),([a-zA-Z0-9]*),([a-fA-F0-9]{32}).htm*
RewriteRule ^(.*) /viewtopic.php?t=%1&postdays=%2&postorder=%3&vote=%4&sid=%4 [L]

lucki2
Posts: 427
Joined: 2006-10-03 01:31

Re: mod_rewrite

Post by lucki2 » 2006-12-18 00:29

Guten Abend, wollte mich grade durch Deine regeln wühlen und mußte feststellen: Funktioniert ja wieder, was wars?