request rewrite emergency*
Igor Sysoev
is at rambler-co.ru
Sun Oct 4 23:34:57 MSD 2009
On Sat, Oct 03, 2009 at 09:36:20PM -0400, saiyan wrote:
> Hello everybody here in NGINX
> Hello Igor, and others.
>
> I need a help regarding rewrite problem
>
> Source:
>
> #
> RewriteEngine on
> # Some hostings require RewriteBase to be uncommented
> # Example:
> # Your store url is http://www.yourcompany.com/store/cart
> # So "RewriteBase" should be:
> # RewriteBase /store/cart
> #RewriteBase /
> #RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$
> #RewriteCond %{REQUEST_FILENAME} !-f
> #RewriteCond %{REQUEST_FILENAME} !-d
> #RewriteRule . index.php?sef_rewrite=1
>
> #RewriteCond %{REQUEST_FILENAME} .*\/catalog\/.*
> #RewriteCond %{REQUEST_FILENAME} -d
> #RewriteCond %{REQUEST_FILENAME}/index.html !-f
> #RewriteRule . index.php?sef_rewrite=1
>
> #
>
> i try this one:
> location / {
> if ($request_filename ~ "\.html$") {
> rewrite ^/(.*)/t-([0-9]+)\.html$ /index.php?sef_rewrite=1 permanent;
> }
> }
>
> but it doesnt work, -__-
> please guide me, thank you very much.
location ~ \.(png|gif|ico|swf|jpe?g|js|css)$ {
try_files $uri $uri/ /index.php?sef_rewrite=1
}
location ~ /catalog/ {
try_files $uri/index.html /index.php?sef_rewrite=1
}
--
Igor Sysoev
http://sysoev.ru/en/
More information about the nginx
mailing list