This is a discussion on [Apache] RewriteRules within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hello, I try to achieve the following in a .htaccess-file: If the URL is not pointing on an existing ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |