Welcome! Log In Create A New Profile

Advanced

Re: apache .htaccess rewrite

April 01, 2010 03:36AM
On Wed, Mar 31, 2010 at 11:20:02PM -0700, Payam Chychi wrote:

> hey Guys,
>
> I cant seem to figure out why I cant properly convert this from apache
> to nginx, any help would be appreciated... ive tried a dozen times but
> it just will not function as expected.
>
> ---
>
> Options +FollowSymLinks
> RewriteEngine On
> RewriteBase /
>
> # URL PATTERN for sitetown
>
> # Main -> Category
> # http://www.site.com/category-name/
> RewriteRule ^([A-Za-z0-9\-]+)/([0-9]+).html$
> results.php?category_id=$2&category=$1 [L]
>
> #New and Improved witht the .html support!
> RewriteRule ^([A-Za-z0-9\-]+)/([0-9]+)/([0-9]+)/([A-Za-z0-9\-]+).html$
> details.php?pid=$2&pkey=$3&category=$1&title=$4 [L]
>
> RewriteRule ^(.*).html$ $1.php

location ~ \.html$ {
rewrite ^/([A-Za-z0-9\-]+)/([0-9]+)\.html$
/results.php?category_id=$2&category=$1
last;

rewrite ^/([A-Za-z0-9\-]+)/([0-9]+)/([0-9]+)/([A-Za-z0-9\-]+)\.html$
/details.php?pid=$2&pkey=$3&category=$1&title=$4
last;

rewrite ^(/.*)\.html$ $1.php last;
}

location ~ \.php$ {
...
}


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

apache .htaccess rewrite

unclepieman April 01, 2010 02:24AM

Re: apache .htaccess rewrite

Igor Sysoev April 01, 2010 03:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 82
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready