Welcome! Log In Create A New Profile

Advanced

Nginx rewrite help: SEO/Permalink

Harish Sundararaj
January 30, 2010 05:26AM
Hi All,

I need to implement a SEO/permalink related rewrite rule on nginx. I'm not
sure how i would do it.
This is what I want:

I have a list which is something like this:

keyA : a1,a2
keyB : b1,b2
keyC : c1, c2
..
..
..
..
KeyZ : z1,z2

Now the access URL will be like this: --->
http://example.com/results/myquery/keyB-keyD-keyK
This should translate to :---> /results?q=myquery&keyvals=b1,b2,d1,d2,k1,k2
The point here to note is I will not know the number of "key" terms that'll
be present in the URL . In the above example I have 3 terms (keyB,keyD and
keyK) ..But there could be any number of them.

I have a couple of questions now:
1) I think i should use "set" to define the key list initially. Is this the
right way? or should I be doing something else?
2) If I have a predefined number of keyterms in the URL i can use the $1,$2
....to match it. But if I don't know the number of terms that'll be present
what should i be doing?

It'll be great if someone can help me with this.

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

Nginx rewrite help: SEO/Permalink

Harish Sundararaj January 30, 2010 05:26AM

Re: Nginx rewrite help: SEO/Permalink

NeWorld January 30, 2010 07:02AM

Re: Nginx rewrite help: SEO/Permalink

Tobia Conforto February 01, 2010 09:38AM

Re: Nginx rewrite help: SEO/Permalink

Harish Sundararaj February 04, 2010 03:24AM

Re: Nginx rewrite help: SEO/Permalink

Tobia Conforto February 04, 2010 06:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 237
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready