| Glenn Kusardi 2005-06-16, 7:47 am |
| Hello,
I try to achieve the following in a .htaccess-file: If the URL is not
pointing on an existing file or directory it should be rewritten and be
executed by a script. If there are no matching rewrite rules the URL
should be given to the script with another parameter.
The following rules are working:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9\_\-]+)\.(html)$ index.php?seite=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9\_\-]+),([0-9]+)\.(html)$
index.php?seite=$1&navigation=$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?weiterleitung=$1 [L]
The rules apply to:
/test123.html -> /index.php?seite=test123
/test123,987.html -> /index.php?seite=test123&navigation=987
/testabc -> /index.php?weiterleitung=testabc
But: The request of /testabc/ is ending in an infinite loop. Is there a
solution to avoid this?
TIA,
Glenn
|