Forum Moderators: bakedjake

Message Too Old, No Replies

mod_rewrite - unexpected error

i want to use rewriterule in .htaccess but i get strange errors

         

davidschubert

3:41 pm on Oct 2, 2003 (gmt 0)

10+ Year Member



Hello,
Iīm using mod_rewrite in my website www.example.com like that and I would be glad if someone would give me a hint, where I made a mistake (problems with this code see below):

------------------------------------------
# URL OK -> donīt rewrite further
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ $1 [NC,L]

# recognise Index-Site
RewriteCond %{REQUEST_FILENAME}/c/index\.php -f
RewriteRule ^(.*)$ /c/index\.php [NC,L]

# extract filename
#RewriteRule ^(.*)\.html$ $1 [S=1]
#RewriteRule ^(.*)\.php$ $1

#try .php-Version of file (when called with .html extension)
#RewriteCond %{REQUEST_FILENAME}.php -f
#RewriteRule ^(.*)$ $1.php [L]

# fast access like
# www.example.com/musik instead of
# www.example.com/dc/musik.php
RewriteCond /dc/%{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ /dc/$1\.php [NC,L]

# Full search-cgi, when nothings fits
RewriteRule ^(.*)$ [example.com...] [L]

----------------------------------------------

OK. Thatīs my idea. When I tried it I get a few very strange errors:

1. fast access doesnīt work (404-error)

2. try .php doesnīt work (404-error)

3. very strange: Fulltext-Search works, but if I access a site that exists, it will load completely and after that starts the MS Debugger with an "syntaxerror in line 1"-Message. even more strange: When I add some stupid RewriteCond like

RewriteCond %{REQUEST_FILENAME} -f

before the RewriteRule-Line the code works - but the fulltext-search doesnīt work any more ;).

I tried a RewriteCond like
RewriteCond %{REQUEST_FILENAME}!-f
and the syntaxerror was back again.

can anyone help me?
David

[edited by: heini at 3:50 pm (utc) on Oct. 2, 2003]
[edit reason] examplified [/edit]

wkitty42

4:26 pm on Oct 2, 2003 (gmt 0)

10+ Year Member



no idea... hopefully jdMorgan is watching... dunno when he is available, though... sometimes work gets in the way ;)