[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-dev
Subject:    [SMARTY-DEV] Re: mod_rewrite
From:       Rainer_Müller <mueller_rainer () gmx ! de>
Date:       2005-04-23 20:08:33
Message-ID: d4e9mq$kul$1 () sea ! gmane ! org
[Download RAW message or body]

David Triebe wrote:
> Hi Pete,
> I've not that much experience with mod_rewrite, but I think, that the
> translation of GET-parameters won't work. 

It works of course.

You could write something like
> this into the .htaccess file:
> 
> RewriteEngine On
> RewriteRule \.html$ index.php
> 
> Which would send every request that goes on a .html-page (no matter if
> existing or not) to the index.php. There you're able to parse the URI
> from $_SERVER['REQUEST_URI'] which should still be the requested one
> without any translations.

I use the following:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/themes.*
RewriteRule ^(.*)$   index.php?path=$1   [L,QSA]

It rewrites if there is no directory and no file with this name and
explicitly excludes request in the themes/ directory which includes my
images (no need for them to be passed through php). [L,QSA] serves that
this is the only rewrite which is done and QSA stands for query string
append. I could even request foo/?blah=bar and it would become
index.php?path=foo/&blah=bar.

HTH, Rainer

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic