[Apache] RewriteRules

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-16-2005
Glenn Kusardi
 
Posts: n/a
Default [Apache] RewriteRules

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:54 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0