PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : mod_rewrite will nicht



0815
06.11.03, 21:28
hi,
versuche vergeblich mod_rewrite zum laufen zu bringen. habe im entsprechenden verzeichnis ein .htaccess-file angelegt, das die regeln zum umschreiben enthält, doch wird die irgendwie nicht akzeptiert. der browser sagt "Internal Server Error
The server encountered an internal error or misconfiguration and was unable ...".
in der error_log von apache finde ich den eintrag ".../.htaccess RewriteEngine not allowed here", oder ".../.htaccess ErrorDocument not allowed here", je nach dem was als 1. Zeile in der .htaccess steht.

OS: mandrake 8.2
apache advanced extranet server 1.3.23
laut phpinfo läuft mod_rewrite

und noch mal mal ein ausschnitt aus der commonhttpd.conf:
...
<Directory />
Options -All -Multiviews
AllowOverride None
order allow,deny
allow from all
AllowOverride AuthConfig
</Directory>
...

und noch ein ausschnitt aus der httpd.conf:
...
ServerType standalone
ServerRoot /etc/httpd
LockFile /etc/httpd/httpd.lock
ErrorLog logs/error_log
LogLevel warn
ResourceConfig /dev/null
Port 80
ServerName 198.0.0.157
Options MultiViews FollowSymlinks SymLinksIfOwnerMatch
DocumentRoot /mnt/fileserver/webserver/html/
AccessFileName .htaccess
...
Include conf/commonhttpd.conf
...

so, ich hoffe mal das ich alle notwendigen bereiche erwicht habe. jemand eine ahnung wo der fehler liegen könnte?
thx.

stefaan
06.11.03, 22:03
Servus!

Was sagt das error_log?

Deine Direktiven für

<Directory />
Options -All -Multiviews
AllowOverride None
order allow,deny
allow from all
AllowOverride AuthConfig
</Directory>


Schauen etwas eigenartig aus. 2x AllowOverride: weiß nicht, wie sich das verträgt.
Probiere einmal bei den Options die FollowSymlinks und Alloverride FileInfo.
Ansonsten halt Alloverride auf All setzen und runtergehen.

Bzw. wie sieht deine .htacces aus?

Grüße, Stefan

0815
06.11.03, 23:16
erstmal danke für die schnelle antwort. also hab die commonhttpd.conf mal so abgeändert:

<Directory />
Options -All -MultiViews FollowSymlinks
AllowOverride None
order allow,deny
allow from all
AllowOverride All
</Directory>

jetzt erscheinen in der error_log zwar keine fehlermeldungen mehr, und die seite wird nun auch im browser angezeigt, doch von wegen veränderter url ist keine spur, nicht mal fehler werden angemeckert. man hat fast den eindruck als ob die .htaccess nun ignoriert wird.

die .htaccess sieht so aus:
ErrorDocument 404 /error.php
DirectoryIndex home.php index.php index.htm index.html
Options FollowSymLinks
RewriteEngine On

# 1: Module (old style call) default action
RewriteRule ^([^\+]+)\+main.html$ modules.php?op=modload&name=$1&file=index [L]

# 2: Module (old style call) with just a req parameter
RewriteRule ^([^\+]+)\+([a-zA-Z0-9_]+).html$ modules.php?op=modload&name=$1&file=index&req=$2 [L]

# 3: Module (new style call) default action
RewriteRule ^([^-]+)-main.html$ index.php?module=$1&func=main [L]

# 4: Article Full Story with default parameters
RewriteRule ^displayarticle([0-9]+).html$ modules.php?op=modload&name=News&file=article&sid=$1&mode=thread&order=0&thold=0 [L]

# 5: Article Full Story with default parameters but mode specified
RewriteRule ^displayarticle([0-9]+)-([^\.])+.html$ modules.php?op=modload&name=News&file=article&sid=$1&mode=$2&order=0&thold=0 [L]

# 6: Send an email about an article
RewriteRule ^sendarticle([0-9]+).html$ modules.php?op=modload&name=Recommend_Us&file=index&req=FriendSend&sid=$1 [L]

# 7: Print an article
RewriteRule ^printarticle([0-9]+).html$ print.php?sid=$1 [L]

# 8: Content Express links for menus
RewriteRule ^Content-([^-]+)-([0-9]+)-([0-9]+)-menu.html$ index.php?module=ContentExpress&func=display&bid=$2&btitle=$1&meid=$3&ceid=-1 [L]

# 9: Content Express links
RewriteRule ^Content-([^-]+)-([0-9]+)-([0-9]+)-([0-9]+).html$ index.php?module=ContentExpress&func=display&bid=$2&btitle=$1&meid=$3&ceid=$4 [L]

# 10: List articles in a topic
RewriteRule ^Topic([0-9]+).html$ modules.php?op=modload&name=News&file=index&catid=&topic=$1 [L]

# 11: List all articles in a topic
RewriteRule ^Topic([0-9]+)allstories.html$ modules.php?op=modload&name=News&file=index&catid=&topic=$1&allstories=1 [L]

# x1: phpBB_14 with 5 parameters
RewriteRule ^phpBB_14-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+).html$ modules.php?op=modload&name=phpBB_14&file=index&action=$1&$2=$3&$4=$5&$6=$7&$8=$9&$10=$11 [L]

# x2: phpBB_14 with 4 parameters
RewriteRule ^phpBB_14-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+).html$ modules.php?op=modload&name=phpBB_14&file=index&action=$1&$2=$3&$4=$5&$6=$7&$8=$9 [L]

# x3: phpBB_14 with 3 parameters
RewriteRule ^phpBB_14-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+).html$ modules.php?op=modload&name=phpBB_14&file=index&action=$1&$2=$3&$4=$5&$6=$7 [L]

# x4: phpBB_14 with 2 parameters
RewriteRule ^phpBB_14-([^-]+)-([^-]+)-([^-]+).html$ modules.php?op=modload&name=phpBB_14&file=index&action=$1&$2=$3&$4=$5 [L]

# x5: phpBB_14 with 1 parameter
RewriteRule ^phpBB_14-([^-]+).html$ modules.php?op=modload&name=phpBB_14&file=index&action=$1&$2=$3 [L]

# x6: phpBB_14 without parameter
RewriteRule ^phpBB_14-([^-]+).html$ modules.php?op=modload&name=phpBB_14&file=index&action=$1 [L]

# x7: postcontact impressum
RewriteRule ^impressum.html$ modules.php?op=modload&name=PostContact&file=index&mode=2 [L]

# #8: PostCalendar: See http://www.postcalendar.tv/displayarticle58.html
RewriteRule ^PostCalendar-Search\.html$ index.php?module=PostCalendar&func=search [L,NC]
RewriteRule ^PostCalendar-AddEvent-([0-9]{2})-([0-9]{2})-([0-9]{4})\.html$ index.php?module=PostCalendar&func=submit&tplview=&Date=$3$2$1 [L,NC]
RewriteRule ^PostCalendar-event-([0-9]+)\.html$ index.php?module=PostCalendar&func=view&Date=&tplview=&viewtype=details&eid=$1&print= [L]
RewriteRule ^PostCalendar-([0-9]{2})-([0-9]{2})-([0-9]{4})-event-([0-9]+)\.html$ index.php?module=PostCalendar&func=view&Date=$3$2$1&tplview=&viewtype=details&eid=$4&print= [L]
RewriteRule ^PostCalendar-([0-9]{2})-([0-9]{2})-([0-9]{4})-([a-zA-Z_]+)-([0-9a-zA-Z_]+)\.html$ index.php?module=PostCalendar&func=view&tplview=$5&viewtype=$4&Date=$3$2$1&pc_username=&pc_category=&pc_topic=&print= [L]
RewriteRule ^PostCalendar-([0-9]{2})-([0-9]{2})-([0-9]{4})-([a-zA-Z_]+)\.html$ index.php?module=PostCalendar&func=view&tplview=&viewtype=$4&Date=$3$2$1&pc_username=&pc_category=&pc_topic=&print= [L]
RewriteRule ^PostCalendar-([0-9]{2})-([0-9]{2})-([0-9]{4})-([a-zA-Z_]+)\.html$ index.php?module=PostCalendar&func=view&viewtype=$4&Date=$2/$1/$3 [L,NC]
RewriteRule ^PostCalendar-([0-9]{2})-([0-9]{2})-([0-9]{4})\.html$ index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&Date=$3$2$1 [L]

# 12: Module (old style call) 5 parameters
RewriteRule ^([^\+]+)\+([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([a-zA-Z0-9_]+).html$ modules.php?op=modload&name=$1&file=$2&$3=$4&$5=$6&$7=$8&$9=$10 [L]

# 13: Module (old style call) 4 parameters
RewriteRule ^([^\+]+)\+([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([a-zA-Z0-9_]+).html$ modules.php?op=modload&name=$1&file=$2&$3=$4&$5=$6&$7=$8 [L]

# 14: Module (old style call) 3 parameters
RewriteRule ^([^\+]+)\+([^-]+)-([^-]+)-([^-]+)-([^-]+)-([a-zA-Z0-9_]+).html$ modules.php?op=modload&name=$1&file=$2&$3=$4&$5=$6 [L]

# 15: Module (new style call) 1 parameters
RewriteRule ^([^\+]+)-([^-]+)-([^-]+)-([a-zA-Z0-9_]+).html$ index.php?module=$1&func=$2&$3=$4 [L]

stefaan
07.11.03, 17:29
Servus!

Fehlt da nicht noch "RewriteBase /(Pfad)"?

Grüße, Stefan