I've been trying to convert this .htaccess for a week now

I hate to ask but this one is just too big and complicated for me to
convert. Any help would be good. Thanks!

RewriteRule ^articles/{0,1}$ articles.php [QSA,L]

RewriteRule ^articles/entry/([^/.]+)/{0,1}$
articles.php?action=viewarticle&articleUri=$1 [QSA,L]

RewriteRule ^articles/entry/{0,1}$
articles.php?action=viewarticle&articleUri=$1 [QSA,L]

RewriteRule ^articles/category/([^/.]+)/{0,1}$
articles.php?action=viewcategory&articleCatUri=$1 [QSA,L]

RewriteRule ^news/{0,1}$ news.php [QSA,L]

RewriteRule ^news/([^/.]+)/{0,1}$ news.php?newsUri=$1 [QSA,L]

RewriteRule ^blogs/{0,1}$ blogs.php [QSA,L]

RewriteRule ^blogs/all/([0-9]+)/([0-9]+)/{0,1}$
blogs.php?page=$2&per_page=$1 [QSA,L]

RewriteRule ^blogs/top/{0,1}$ blogs.php?action=top_blogs [QSA,L]

RewriteRule ^blogs/top/([0-9]+)/([0-9]+)/{0,1}$
blogs.php?action=top_blogs&page=$2&per_page=$1 [QSA,L]

RewriteRule ^blogs/top_posts/{0,1}$ blogs.php?action=top_posts [QSA,L]

RewriteRule ^blogs/tag/([^/.]+)/{0,1}$
blogs.php?action=search_by_tag&tagKey=$1 [QSA,L]

RewriteRule ^blogs/tag/{0,1}$ blogs.php?action=search_by_tag&tagKey=
[QSA,L]

RewriteRule ^blogs/posts/([^/.]+)/tag/([^/.]+)/{0,1}$
blogs.php?action=search_by_tag&tagKey=$2&ownerName=$1 [QSA,L]

RewriteRule ^blogs/posts/([^/.]+)/category/([^/.]+)/{0,1}$
blogs.php?action=show_member_blog&ownerName=$1&categoryUri=$2 [QSA,L]

RewriteRule ^blogs/entry/([^/.]+)/{0,1}$
blogs.php?action=show_member_post&postUri=$1 [QSA,L]

RewriteRule ^blogs/entry/{0,1}$
blogs.php?action=show_member_post&postUri= [QSA,L]

RewriteRule ^blogs/posts/([^/.]+)/{0,1}$
blogs.php?action=show_member_blog&ownerName=$1 [QSA,L]

RewriteRule ^blogs/posts/{0,1}$
blogs.php?action=show_member_blog&ownerName= [QSA,L]

RewriteRule ^blogs/posts/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$
blogs.php?action=show_member_blog&ownerName=$1&page=$3&per_page=$2
[QSA,L]

RewriteRule
^blogs/posts/([^/.]+)/category/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$
blogs.php?action=show_member_blog&ownerName=$1&categoryUri=$2&page=$4&per_pa
ge=$3 [QSA,L]

RewriteRule ^events/{0,1}$ events.php?show_events=all&action=show
[QSA,L]

RewriteRule ^events/all/([0-9]+)/([0-9]+)/{0,1}$
events.php?show_events=all&action=show&page=$2&per_page=$1 [QSA,L]

RewriteRule ^events/part/{0,1}$ events.php?show_events=all&action=show
[QSA,L]

RewriteRule ^events/search/{0,1}$ events.php?action=search [QSA,L]

RewriteRule ^events/search/([^/.]+)/{0,1}$
events.php?action=search_by_tag&tagKey=$1 [QSA,L]

RewriteRule ^events/my/{0,1}$ events.php?action=show&show_events=my
[QSA,L]

RewriteRule ^events/new/{0,1}$ events.php?action=new [QSA,L]

RewriteRule ^events/entry/([^/.]+)/{0,1}$
events.php?action=show_info&eventUri=$1 [QSA,L]

RewriteRule ^events/part/([^/.]+)/{0,1}$
events.php?action=show_part&eventUri=$1 [QSA,L]

RewriteRule ^ads/{0,1}$ classifieds.php?Browse=1 [QSA,L]

RewriteRule ^ads/search/{0,1}$ classifieds.php?SearchForm=1 [QSA,L]

RewriteRule ^ads/my/{0,1}$ classifiedsmy.php?MyAds=1 [QSA,L]

RewriteRule ^ads/new/{0,1}$ classifiedsmy.php?PostAd=1 [QSA,L]

RewriteRule ^ads/cat/([^/.]+)/{0,1}$ classifieds.php?catUri=$1 [QSA,L]

RewriteRule ^ads/all/cat/([0-9]+)/([0-9]+)/([^/.]+)/{0,1}$
classifieds.php?catUri=$3&page=$2&per_page=$1 [QSA,L]

RewriteRule ^ads/subcat/([^/.]+)/{0,1}$ classifieds.php?scatUri=$1
[QSA,L]

RewriteRule ^ads/all/subcat/([0-9]+)/([0-9]+)/([^/.]+)/{0,1}$
classifieds.php?scatUri=$3&page=$2&per_page=$1 [QSA,L]

RewriteRule ^ads/entry/([^/.]+)/{0,1}$ classifieds.php?entryUri=$1
[QSA,L]

RewriteRule ^ads/tag/([^/.]+)/{0,1}$ classifieds_tags.php?tag=$1
[QSA,L]

RewriteRule ^photo/all/([0-9]+)/([0-9]+)/{0,1}$
browsePhoto.php?page=$2&per_page=$1 [QSA,L]

RewriteRule ^photo/gallery_top/{0,1}$ browsePhoto.php?rate=top [QSA,L]

RewriteRule ^photo/gallery_top/([0-9]+)/([0-9]+)/{0,1}$
browsePhoto.php?rate=top&page=$2&per_page=$1 [QSA,L]

RewriteRule ^photo/gallery_top/([0-9]+)/([0-9]+)/{0,1}$
browsePhoto.php?rate=top&page=$2&per_page=$1 [QSA,L]

RewriteRule ^photo/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$
browsePhoto.php?tag=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^photo/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/$
browsePhoto.php?tag=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^photo/gallery_tag/([^/.]+)/{0,1}$ browsePhoto.php?tag=$1
[QSA,L]

RewriteRule ^photo/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)$
browsePhoto.php?ownerName=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^photo/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)/$
browsePhoto.php?ownerName=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^photo/gallery/all/([^/.]+)/{0,1}$
browsePhoto.php?ownerName=$1
[QSA,L]

RewriteRule ^photo/gallery/([^/.]+)/{0,1}$ viewPhoto.php?fileUri=$1
[QSA,L]

RewriteRule ^photo/gallery/{0,1}$ viewPhoto.php?fileUri=$1 [QSA,L]

RewriteRule ^music/all/([0-9]+)/([0-9]+)/{0,1}$
browseMusic.php?page=$2&per_page=$1 [QSA,L]

RewriteRule ^music/gallery_top/{0,1}$ browseMusic.php?rate=top [QSA,L]

RewriteRule ^music/gallery_top/([0-9]+)/([0-9]+)/{0,1}$
browseMusic.php?rate=top&page=$2&per_page=$1 [QSA,L]

RewriteRule ^music/gallery_top/([0-9]+)/([0-9]+)/{0,1}$
browseMusic.php?rate=top&page=$2&per_page=$1 [QSA,L]

RewriteRule ^music/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$
browseMusic.php?tag=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^music/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/$
browseMusic.php?tag=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^music/gallery_tag/([^/.]+)/{0,1}$ browseMusic.php?tag=$1
[QSA,L]

RewriteRule ^music/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)$
browseMusic.php?ownerName=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^music/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)/$
browseMusic.php?ownerName=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^music/gallery/all/([^/.]+)/{0,1}$
browseMusic.php?ownerName=$1
[QSA,L]

RewriteRule ^music/gallery/([^/.]+)/{0,1}$ viewMusic.php?fileUri=$1
[QSA,L]

RewriteRule ^music/gallery/{0,1}$ viewMusic.php?fileUri=$1 [QSA,L]

RewriteRule ^video/all/([0-9]+)/([0-9]+)/{0,1}$
browseVideo.php?page=$2&per_page=$1 [QSA,L]

RewriteRule ^video/gallery_top/{0,1}$ browseVideo.php?rate=top [QSA,L]

RewriteRule ^video/gallery_top/([0-9]+)/([0-9]+)/{0,1}$
browseVideo.php?rate=top&page=$2&per_page=$1 [QSA,L]

RewriteRule ^video/gallery_top/([0-9]+)/([0-9]+)/{0,1}$
browseVideo.php?rate=top&page=$2&per_page=$1 [QSA,L]

RewriteRule ^video/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$
browseVideo.php?tag=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^video/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/$
browseVideo.php?tag=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^video/gallery_tag/([^/.]+)/{0,1}$ browseVideo.php?tag=$1
[QSA,L]

RewriteRule ^video/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)$
browseVideo.php?ownerName=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^video/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)/$
browseVideo.php?ownerName=$1&page=$3&per_page=$2 [QSA,L]

RewriteRule ^video/gallery/all/([^/.]+)/{0,1}$
browseVideo.php?ownerName=$1
[QSA,L]

RewriteRule ^video/gallery/([^/.]+)/{0,1}$ viewVideo.php?fileUri=$1
[QSA,L]

RewriteRule ^video/gallery/{0,1}$ viewVideo.php?fileUri=$1 [QSA,L]

RewriteRule ^groups/all/{0,1}$ grp.php [QSA,L]

RewriteRule ^groups/entry/([^/.]+)/{0,1}$
grp.php?action=group&groupUri=$1 [QSA,L]

RewriteRule ^groups/category/([^/.]+)/{0,1}$
grp.php?action=categ&categUri=$1 [QSA,L]

RewriteRule ^groups/keyword/([^/.]+)/{0,1}$
grp.php?action=categ&keyword=$1 [QSA,L]

RewriteRule ^search/tag/([^/.]+)/{0,1}$ search.php?Tags=$1 [QSA,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule .+ - [L]

RewriteRule ^([A-Za-z0-9_-]+)$ profile.php?ID=$1 [QSA,L]

Regards,

-Team AMP

http://www.ampprod.com

Try this one:
rewrite ^/articles/{0,1}$ /;
rewrite ^/articles/entry/([^/.]+)/{0,1}$ /;
rewrite ^/articles/entry/{0,1}$ /;
rewrite ^/articles/category/([^/.]+)/{0,1}$ /;
setenv ;
rewrite ^/news/{0,1}$ /;
setenv $;
rewrite ^/news/([^/.]+)/{0,1}$ /;
rewrite ^/blogs/{0,1}$ /;
rewrite ^/blogs/all/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/blogs/top/{0,1}$ /;
rewrite ^/blogs/top/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/blogs/top_posts/{0,1}$ /;
rewrite ^/blogs/tag/([^/.]+)/{0,1}$ /;
rewrite ^/blogs/tag/{0,1}$ /;
rewrite ^/blogs/posts/([^/.]+)/tag/([^/.]+)/{0,1}$ /;
rewrite ^/blogs/posts/([^/.]+)/category/([^/.]+)/{0,1}$ /;
rewrite ^/blogs/entry/([^/.]+)/{0,1}$ /;
rewrite ^/blogs/entry/{0,1}$ /;
rewrite ^/blogs/posts/([^/.]+)/{0,1}$ /;
rewrite ^/blogs/posts/{0,1}$ /;
rewrite ^/blogs/posts/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite / /;
rewrite ^/events/{0,1}$ /;
rewrite ^/events/all/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/events/part/{0,1}$ /;
rewrite ^/events/search/{0,1}$ /;
rewrite ^/events/search/([^/.]+)/{0,1}$ /;
rewrite ^/events/my/{0,1}$ /;
rewrite ^/events/new/{0,1}$ /;
rewrite ^/events/entry/([^/.]+)/{0,1}$ /;
rewrite ^/events/part/([^/.]+)/{0,1}$ /;
rewrite ^/ads/{0,1}$ / last;
rewrite ^/ads/search/{0,1}$ / last;
rewrite ^/ads/my/{0,1}$ / last;
rewrite ^/ads/new/{0,1}$ / last;
rewrite ^/ads/cat/([^/.]+)/{0,1}$ / last;
rewrite ^/ads/all/cat/([0-9]+)/([0-9]+)/([^/.]+)/{0,1}$ /;
rewrite ^/ads/subcat/([^/.]+)/{0,1}$ / last;
rewrite ^/ads/all/subcat/([0-9]+)/([0-9]+)/([^/.]+)/{0,1}$ /;
rewrite ^/ads/entry/([^/.]+)/{0,1}$ / last;
rewrite ^/ads/tag/([^/.]+)/{0,1}$ / last;
rewrite ^/photo/all/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/photo/gallery_top/{0,1}$ / redirect;
break;
rewrite ^/photo/gallery_top/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/photo/gallery_top/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/photo/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/photo/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/$ /;
rewrite ^/photo/gallery_tag/([^/.]+)/{0,1}$ / redirect;
break;
rewrite ^/photo/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)$ /;
rewrite ^/photo/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)/$ /;
rewrite ^/photo/gallery/all/([^/.]+)/{0,1}$ /;
rewrite ^/photo/gallery/([^/.]+)/{0,1}$ /;
rewrite ^/photo/gallery/{0,1}$ /;
rewrite ^/music/all/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/music/gallery_top/{0,1}$ / redirect;
break;
rewrite ^/music/gallery_top/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/music/gallery_top/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/music/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/music/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/$ /;
rewrite ^/music/gallery_tag/([^/.]+)/{0,1}$ / redirect;
break;
rewrite ^/music/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)$ /;
rewrite ^/music/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)/$ /;
rewrite ^/music/gallery/all/([^/.]+)/{0,1}$ /;
rewrite ^/music/gallery/([^/.]+)/{0,1}$ /;
rewrite ^/music/gallery/{0,1}$ /;
rewrite ^/video/all/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/video/gallery_top/{0,1}$ / redirect;
break;
rewrite ^/video/gallery_top/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/video/gallery_top/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/video/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/{0,1}$ /;
rewrite ^/video/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/$ /;
rewrite ^/video/gallery_tag/([^/.]+)/{0,1}$ / redirect;
break;
rewrite ^/video/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)$ /;
rewrite ^/video/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)/$ /;
rewrite ^/video/gallery/all/([^/.]+)/{0,1}$ /;
rewrite ^/video/gallery/([^/.]+)/{0,1}$ /;
rewrite ^/video/gallery/{0,1}$ /;
rewrite ^/groups/all/{0,1}$ /grp.php last;
rewrite ^/groups/entry/([^/.]+)/{0,1}$ /;
rewrite ^/groups/category/([^/.]+)/{0,1}$ /;
rewrite ^/groups/keyword/([^/.]+)/{0,1}$ /;
setenv $;
rewrite ^/search/tag/([^/.]+)/{0,1}$ /;
if (-f $request_filename){
set $rule_81 1;
}
if (-d $request_filename){
set $rule_81 1;
}
if ($rule_81 = “1”){
#ignored: “-” thing used or unknown variable in regex/rew
}
rewrite ^/([A-Za-z0-9_-]+)$ /profile.php?ID=$1 last;

No luck.

Ps- I think that is similar to the automatic converter script I tried.

Regards,

-Team AMP
http://www.ampprod.com

AMP Admin wrote:

No luck.

Ps- I think that is similar to the automatic converter script I tried.

Regards,

-Team AMP
http://www.ampprod.com

Yes i think some things are extra like redirect and last.Try with line
by line.

On Tue, Dec 29, 2009 at 1:28 PM, merlin corey [email protected]
wrote:

Not really sure what this one is checking…

RewriteRule ^([A-Za-z0-9_-]+)$ profile.php?ID=$1 [QSA,L]

Regular expression location with captures again.

– Merlin

Actually these last few rules are all for root location try_files like
so:
location / {
try_files $uri $uri/ /profile.php?ID=$uri;
}

– Merlin

That is the original htaccess file. I didn’t put my changes. Also,
it’s
been on and off for a week so maybe I over exaggerated a bit.

Regards,

-Team AMP
http://www.ampprod.com

====== CONFIDENTIALITY NOTICE ======
NOTICE: This e-mail message and all attachments transmitted with it may
contain legally privileged and confidential information intended solely
for
the use of the addressee. If the reader of this message is not the
intended
recipient, you are hereby notified that any reading, dissemination,
distribution, copying, or other use of this message or its attachments
is
strictly prohibited. If you have received this message in error, please
notify the sender immediately and delete this message from your system.
Thank you.

Thanks.

Regards,

-Team AMP
http://www.ampprod.com

On Mon, Dec 28, 2009 at 6:24 PM, AMP Admin [email protected] wrote:

I hate to ask but this one is just too big and complicated for me to
convert. Any help would be good. Thanks!

You really tried for a week? I don’t see any nginx configuration
here, just a dump of an apache configuration.

articles.php?action=viewcategory&articleCatUri=$1 [QSA,L]

RewriteRule ^blogs/tag/([^/.]+)/{0,1}$

blogs.php?action=show_member_blog&ownerName= [QSA,L]

RewriteRule ^events/search/([^/.]+)/{0,1}$
events.php?action=show_part&eventUri=$1 [QSA,L]

RewriteRule ^ads/entry/([^/.]+)/{0,1}$ classifieds.php?entryUri=$1 [QSA,L]
RewriteRule ^photo/gallery_top/([0-9]+)/([0-9]+)/{0,1}$

[QSA,L]
RewriteRule ^music/gallery_top/{0,1}$ browseMusic.php?rate=top [QSA,L]
RewriteRule ^music/gallery_tag/([^/.]+)/([0-9]+)/([0-9]+)/$

browseVideo.php?page=$2&per_page=$1 [QSA,L]
browseVideo.php?tag=$1&page=$3&per_page=$2 [QSA,L]
RewriteRule ^video/gallery/all/([^/.]+)/([0-9]+)/([0-9]+)/$

RewriteRule ^search/tag/([^/.]+)/{0,1}$ search.php?Tags=$1 [QSA,L]

I would probably do these with regular expression locations with
captures and then either pass directly to fastcgi what I want or
proceed with rewrite.

RewriteCond %{REQUEST_FILENAME} -f [OR]

RewriteCond %{REQUEST_FILENAME} -d

This part of course with try_files in root location.

RewriteRule .+ - [L]

Not really sure what this one is checking…

RewriteRule ^([A-Za-z0-9_-]+)$ profile.php?ID=$1 [QSA,L]

Regular expression location with captures again.

– Merlin

THIS IS SO FRUSTRATING!

Is there away to serve all of the rewrite stuff or just the .htaccess
files
through apache until we get this figured out? I really hate to have to
install apache just to get the .htaccess/rewrites to work but maybe
that’s
the easiest solution for now.

Regards,

-Team AMP
http://www.ampprod.com

-------- Original-Nachricht --------

Datum: Mon, 28 Dec 2009 20:24:14 -0600
Von: “AMP Admin” [email protected]
An: [email protected]
Betreff: i've been trying to convert this .htaccess for a week now

I hate to ask but this one is just too big and complicated for me to
convert. Any help would be good. Thanks!

[removed long list of Apache Rewrite rules]

Since I don’t know where you need those rewrites and what version of
nginx you are using and how you have setup the other stuff in nginx I am
not able to optimize the rewrite rules (some stuff can be done without
rewriting when using newer version of nginx). Anyway… here a
suggestion (you might need to change “permanent” to “last” or in some
cases to “break” but all this depends where you add those rewrite rules
in your nginx.conf):

rewrite ^/articles/?$ /articles.php permanent;
rewrite ^/articles/([^/.]+)/?$
/articles.php?action=viewarticle&articleUri=$1? permanent;
rewrite ^/articles/category/([^/.]+)/?$
/articles.php?action=viewcategory&articleCatUri=$1? permanent;

rewrite ^/news/?$ /news.php permanent;
rewrite ^/news/([^/.]+)/?$ /news.php?newsUri=$1? permanent;

rewrite ^/blogs/?$ /blogs.php permanent;
rewrite ^/blogs/all/(\d+)/(\d+)/?$ /blogs.php?page=$2&per_page=$1?
permanent;
rewrite ^/blogs/top/?$ /blogs.php?action=top_blogs? permanent;
rewrite ^/blogs/top/(\d+)/(\d+)/?$
/blogs.php?action=top_blogs&page=$2&per_page=$1? permanent;
rewrite ^/blogs/top_posts/?$ /blogs.php?action=top_posts? permanent;
rewrite ^/blogs/tag/([^/.]+)/?$
/blogs.php?action=search_by_tag&tagKey=$1? permanent;
rewrite ^/blogs/tag/?$ /blogs.php?action=search_by_tag&tagKey=?
permanent;
rewrite ^/blogs/posts/([^/.]+)/tag/([^/.]+)/?$
/blogs.php?action=search_by_tag&tagKey=$2&ownerName=$1? permanent;
rewrite ^/blogs/posts/([^/.]+)/category/([^/.]+)/?$
/blogs.php?action=show_member_blog&ownerName=$1&categoryUri=$2?
permanent;
rewrite ^/blogs/entry/([^/.]+)/?$
/blogs.php?action=show_member_post&postUri=$1? permanent;
rewrite ^/blogs/entry/?$ /blogs.php?action=show_member_post&postUri=?
permanent;
rewrite ^/blogs/posts/([^/.]+)/?$
/blogs.php?action=show_member_blog&ownerName=$1? permanent;
rewrite ^/blogs/posts/?$ /blogs.php?action=show_member_blog&ownerName=?
permanent;
rewrite ^/blogs/posts/([^/.]+)/(\d+)/(\d+)/?$
/blogs.php?action=show_member_blog&ownerName=$1&page=$3&per_page=$2?
permanent;
rewrite ^/blogs/posts/([^/.]+)/category/([^/.]+)/(\d+)/(\d+)/?$
/blogs.php?action=show_member_blog&ownerName=$1&categoryUri=$2&page=$4&per_page=$3?
permanent;

rewrite ^/events/?$ /events.php?show_events=all&action=show?
permanent;
rewrite ^/events/all/(\d+)/(\d+)/?$
/events.php?show_events=all&action=show&page=$2&per_page=$1? permanent;
rewrite ^/events/part/?$ /events.php?show_events=all&action=show?
permanent;
rewrite ^/events/search/?$ /events.php?action=search? permanent;
rewrite ^/events/search/([^/.]+)/?$
/events.php?action=search_by_tag&tagKey=$1? permanent;
rewrite ^/events/my/?$ /events.php?action=show&show_events=my?
permanent;
rewrite ^/events/new/?$ /events.php?action=new? permanent;
rewrite ^/events/entry/([^/.]+)/?$
/events.php?action=show_info&eventUri=$1? permanent;
rewrite ^/events/part/([^/.]+)/?$
/events.php?action=show_part&eventUri=$1? permanent;

rewrite ^/ads/?$ /classifieds.php?Browse=1? permanent;
rewrite ^/ads/search/?$ /classifieds.php?SearchForm=1? permanent;
rewrite ^/ads/my/?$ /classifiedsmy.php?MyAds=1? permanent;
rewrite ^/ads/new/?$ /classifiedsmy.php?PostAd=1? permanent;
rewrite ^/ads/cat/([^/.]+)/?$ /classifieds.php?catUri=$1? permanent;
rewrite ^/ads/all/cat/(\d+)/(\d+)/([^/.]+)/?$
/classifieds.php?catUri=$3&page=$2&per_page=$1? permanent;
rewrite ^/ads/subcat/([^/.]+)/?$ /classifieds.php?scatUri=$1?
permanent;
rewrite ^/ads/all/subcat/(\d+)/(\d+)/([^/.]+)/?$
/classifieds.php?scatUri=$3&page=$2&per_page=$1? permanent;
rewrite ^/ads/entry/([^/.]+)/?$ /classifieds.php?entryUri=$1?
permanent;
rewrite ^/ads/tag/([^/.]+)/?$ /classifieds_tags.php?tag=$1? permanent;

rewrite ^/photo/all/(\d+)/(\d+)/?$
/browsePhoto.php?page=$2&per_page=$1? permanent;
rewrite ^/photo/gallery_top/?$ /browsePhoto.php?rate=top? permanent;
rewrite ^/photo/gallery_top/(\d+)/(\d+)/?$
/browsePhoto.php?rate=top&page=$2&per_page=$1? permanent;
rewrite ^/photo/gallery_tag/([^/.]+)/(\d+)/(\d+)/?$
/browsePhoto.php?tag=$1&page=$3&per_page=$2? permanent;
rewrite ^/photo/gallery_tag/([^/.]+)/?$ /browsePhoto.php?tag=$1?
permanent;
rewrite ^/photo/gallery/all/([^/.]+)/(\d+)/(\d+)/?$
/browsePhoto.php?ownerName=$1&page=$3&per_page=$2? permanent;
rewrite ^/photo/gallery/all/([^/.]+)/?$ /browsePhoto.php?ownerName=$1?
permanent;
rewrite ^/photo/gallery/([^/.]+)/?$ /viewPhoto.php?fileUri=$1?
permanent;
rewrite ^/photo/gallery/?$ /viewPhoto.php?fileUri=$1? permanent;

rewrite ^/music/all/(\d+)/(\d+)/?$
/browseMusic.php?page=$2&per_page=$1? permanent;
rewrite ^/music/gallery_top/?$ /browseMusic.php?rate=top? permanent;
rewrite ^/music/gallery_top/(\d+)/(\d+)/?$
/browseMusic.php?rate=top&page=$2&per_page=$1? permanent;
rewrite ^/music/gallery_tag/([^/.]+)/(\d+)/(\d+)/?$
/browseMusic.php?tag=$1&page=$3&per_page=$2? permanent;
rewrite ^/music/gallery_tag/([^/.]+)/?$ /browseMusic.php?tag=$1?
permanent;
rewrite ^/music/gallery/all/([^/.]+)/(\d+)/(\d+)/?$
/browseMusic.php?ownerName=$1&page=$3&per_page=$2? permanent;
rewrite ^/music/gallery/all/([^/.]+)/?$ /browseMusic.php?ownerName=$1?
permanent;
rewrite ^/music/gallery/([^/.]+)/?$ /viewMusic.php?fileUri=$1?
permanent;
rewrite ^/music/gallery/?$ /viewMusic.php?fileUri=$1? permanent;

rewrite ^/video/all/(\d+)/(\d+)/?$
/browseVideo.php?page=$2&per_page=$1? permanent;
rewrite ^/video/gallery_top/?$ /browseVideo.php?rate=top? permanent;
rewrite ^/video/gallery_top/(\d+)/(\d+)/?$
/browseVideo.php?rate=top&page=$2&per_page=$1? permanent;
rewrite ^/video/gallery_tag/([^/.]+)/(\d+)/(\d+)/?$
/browseVideo.php?tag=$1&page=$3&per_page=$2? permanent;
rewrite ^/video/gallery_tag/([^/.]+)/?$ /browseVideo.php?tag=$1?
permanent;
rewrite ^/video/gallery/all/([^/.]+)/(\d+)/(\d+)/?$
/browseVideo.php?ownerName=$1&page=$3&per_page=$2? permanent;
rewrite ^/video/gallery/all/([^/.]+)/?$ /browseVideo.php?ownerName=$1?
permanent;
rewrite ^/video/gallery/([^/.]+)/?$ /viewVideo.php?fileUri=$1?
permanent;
rewrite ^/video/gallery/?$ /viewVideo.php?fileUri=$1? permanent;

rewrite ^/groups/all/?$ /grp.php permanent;
rewrite ^/groups/entry/([^/.]+)/?$ /grp.php?action=group&groupUri=$1?
permanent;
rewrite ^/groups/category/([^/.]+)/?$
/grp.php?action=categ&categUri=$1? permanent;
rewrite ^/groups/keyword/([^/.]+)/?$ /grp.php?action=categ&keyword=$1?
permanent;

rewrite ^/search/tag/([^/.]+)/?$ /search.php?Tags=$1 permanent;

Maybe using location is better?:

location /articles/ {
rewrite ^/articles/?$ /articles.php;
rewrite ^/articles/([^/.]+)/?$
/articles.php?action=viewarticle&articleUri=$1?;
rewrite ^/articles/category/([^/.]+)/?$
/articles.php?action=viewcategory&articleCatUri=$1?;
}

location /news/ {
rewrite ^/news/?$ /news.php;
rewrite ^/news/([^/.]+)/?$ /news.php?newsUri=$1?;
}

location /blogs/ {
rewrite ^/blogs/?$ /blogs.php;
rewrite ^/blogs/all/(\d+)/(\d+)/?$ /blogs.php?page=$2&per_page=$1?;
rewrite ^/blogs/top/?$ /blogs.php?action=top_blogs?;
rewrite ^/blogs/top/(\d+)/(\d+)/?$
/blogs.php?action=top_blogs&page=$2&per_page=$1?;
rewrite ^/blogs/top_posts/?$ /blogs.php?action=top_posts?;
rewrite ^/blogs/tag/([^/.]+)/?$
/blogs.php?action=search_by_tag&tagKey=$1?;
rewrite ^/blogs/tag/?$ /blogs.php?action=search_by_tag&tagKey=?;
rewrite ^/blogs/posts/([^/.]+)/tag/([^/.]+)/?$
/blogs.php?action=search_by_tag&tagKey=$2&ownerName=$1?;
rewrite ^/blogs/posts/([^/.]+)/category/([^/.]+)/?$
/blogs.php?action=show_member_blog&ownerName=$1&categoryUri=$2?;
rewrite ^/blogs/entry/([^/.]+)/?$
/blogs.php?action=show_member_post&postUri=$1?;
rewrite ^/blogs/entry/?$ /blogs.php?action=show_member_post&postUri=?;
rewrite ^/blogs/posts/([^/.]+)/?$
/blogs.php?action=show_member_blog&ownerName=$1?;
rewrite ^/blogs/posts/?$
/blogs.php?action=show_member_blog&ownerName=?;
rewrite ^/blogs/posts/([^/.]+)/(\d+)/(\d+)/?$
/blogs.php?action=show_member_blog&ownerName=$1&page=$3&per_page=$2?;
rewrite ^/blogs/posts/([^/.]+)/category/([^/.]+)/(\d+)/(\d+)/?$
/blogs.php?action=show_member_blog&ownerName=$1&categoryUri=$2&page=$4&per_page=$3?;
}

location /events/ {
rewrite ^/events/?$ /events.php?show_events=all&action=show?;
rewrite ^/events/all/(\d+)/(\d+)/?$
/events.php?show_events=all&action=show&page=$2&per_page=$1?;
rewrite ^/events/part/?$ /events.php?show_events=all&action=show?;
rewrite ^/events/search/?$ /events.php?action=search?;
rewrite ^/events/search/([^/.]+)/?$
/events.php?action=search_by_tag&tagKey=$1?;
rewrite ^/events/my/?$ /events.php?action=show&show_events=my?;
rewrite ^/events/new/?$ /events.php?action=new?;
rewrite ^/events/entry/([^/.]+)/?$
/events.php?action=show_info&eventUri=$1?;
rewrite ^/events/part/([^/.]+)/?$
/events.php?action=show_part&eventUri=$1?;
}

location /ads/ {
rewrite ^/ads/?$ /classifieds.php?Browse=1?;
rewrite ^/ads/search/?$ /classifieds.php?SearchForm=1?;
rewrite ^/ads/my/?$ /classifiedsmy.php?MyAds=1?;
rewrite ^/ads/new/?$ /classifiedsmy.php?PostAd=1?;
rewrite ^/ads/cat/([^/.]+)/?$ /classifieds.php?catUri=$1?;
rewrite ^/ads/all/cat/(\d+)/(\d+)/([^/.]+)/?$
/classifieds.php?catUri=$3&page=$2&per_page=$1?;
rewrite ^/ads/subcat/([^/.]+)/?$ /classifieds.php?scatUri=$1?;
rewrite ^/ads/all/subcat/(\d+)/(\d+)/([^/.]+)/?$
/classifieds.php?scatUri=$3&page=$2&per_page=$1?;
rewrite ^/ads/entry/([^/.]+)/?$ /classifieds.php?entryUri=$1?;
rewrite ^/ads/tag/([^/.]+)/?$ /classifieds_tags.php?tag=$1?;
}

location /photo/ {
rewrite ^/photo/all/(\d+)/(\d+)/?$
/browsePhoto.php?page=$2&per_page=$1?;
rewrite ^/photo/gallery_top/?$ /browsePhoto.php?rate=top?;
rewrite ^/photo/gallery_top/(\d+)/(\d+)/?$
/browsePhoto.php?rate=top&page=$2&per_page=$1?;
rewrite ^/photo/gallery_tag/([^/.]+)/(\d+)/(\d+)/?$
/browsePhoto.php?tag=$1&page=$3&per_page=$2?;
rewrite ^/photo/gallery_tag/([^/.]+)/?$ /browsePhoto.php?tag=$1?;
rewrite ^/photo/gallery/all/([^/.]+)/(\d+)/(\d+)/?$
/browsePhoto.php?ownerName=$1&page=$3&per_page=$2?;
rewrite ^/photo/gallery/all/([^/.]+)/?$
/browsePhoto.php?ownerName=$1?;
rewrite ^/photo/gallery/([^/.]+)/?$ /viewPhoto.php?fileUri=$1?;
rewrite ^/photo/gallery/?$ /viewPhoto.php?fileUri=$1?;
}

location /music/ {
rewrite ^/music/all/(\d+)/(\d+)/?$
/browseMusic.php?page=$2&per_page=$1?;
rewrite ^/music/gallery_top/?$ /browseMusic.php?rate=top?;
rewrite ^/music/gallery_top/(\d+)/(\d+)/?$
/browseMusic.php?rate=top&page=$2&per_page=$1?;
rewrite ^/music/gallery_tag/([^/.]+)/(\d+)/(\d+)/?$
/browseMusic.php?tag=$1&page=$3&per_page=$2?;
rewrite ^/music/gallery_tag/([^/.]+)/?$ /browseMusic.php?tag=$1?;
rewrite ^/music/gallery/all/([^/.]+)/(\d+)/(\d+)/?$
/browseMusic.php?ownerName=$1&page=$3&per_page=$2?;
rewrite ^/music/gallery/all/([^/.]+)/?$
/browseMusic.php?ownerName=$1?;
rewrite ^/music/gallery/([^/.]+)/?$ /viewMusic.php?fileUri=$1?;
rewrite ^/music/gallery/?$ /viewMusic.php?fileUri=$1?;
}

location /video/ {
rewrite ^/video/all/(\d+)/(\d+)/?$
/browseVideo.php?page=$2&per_page=$1?;
rewrite ^/video/gallery_top/?$ /browseVideo.php?rate=top?;
rewrite ^/video/gallery_top/(\d+)/(\d+)/?$
/browseVideo.php?rate=top&page=$2&per_page=$1?;
rewrite ^/video/gallery_tag/([^/.]+)/(\d+)/(\d+)/?$
/browseVideo.php?tag=$1&page=$3&per_page=$2?;
rewrite ^/video/gallery_tag/([^/.]+)/?$ /browseVideo.php?tag=$1?;
rewrite ^/video/gallery/all/([^/.]+)/(\d+)/(\d+)/?$
/browseVideo.php?ownerName=$1&page=$3&per_page=$2?;
rewrite ^/video/gallery/all/([^/.]+)/?$
/browseVideo.php?ownerName=$1?;
rewrite ^/video/gallery/([^/.]+)/?$ /viewVideo.php?fileUri=$1?;
rewrite ^/video/gallery/?$ /viewVideo.php?fileUri=$1?;
}

location /groups/ {
rewrite ^/groups/all/?$ /grp.php;
rewrite ^/groups/entry/([^/.]+)/?$ /grp.php?action=group&groupUri=$1?;
rewrite ^/groups/category/([^/.]+)/?$
/grp.php?action=categ&categUri=$1?;
rewrite ^/groups/keyword/([^/.]+)/?$
/grp.php?action=categ&keyword=$1?;
}

location /search/tag/ {
rewrite ^/search/tag/([^/.]+)/?$ /search.php?Tags=$1?;
}

location / {
try_files $uri $uri/ /profile.php?ID=$uri;
}

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .+ - [L]
RewriteRule ^([A-Za-z0-9_-]+)$ profile.php?ID=$1 [QSA,L]

Those here could be done with a try rule. Something like:

location / {
try_files $uri $uri/ /profile.php?ID=$uri;
}

Or:

location / {
if (-e $request_filename) {
set $ampr01 1;
}
if ($request_filename ~* “^([A-Za-z0-9_-]+)$”) {
set $ampr02 1;
}
if ($ampr01$ampr02 = “11”) {
rewrite ^/([A-Za-z0-9_-]+)$ /profile.php?ID=$1 last;
break;
}
}

I have not tested those rules. I don’t know if they work.

Regards,

Kind Regards,

-Team AMP

Steve

http://www.ampprod.com


GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter Aktuelle Nachrichten aus Politik, Wirtschaft & Panorama | GMX

Wow! This is awesome! I’ll start working with this and see what I can
come
up with.

Btw, I’m running Nginx 0.7.64

-------- Original-Nachricht --------

Datum: Tue, 29 Dec 2009 20:35:15 -0600
Von: “AMP Admin” [email protected]
An: [email protected]
Betreff: RE: i've been trying to convert this .htaccess for a week now

Wow! This is awesome! I’ll start working with this and see what I can
come
up with.

It would help if you could post the whole configuration you use for that
software. I mean the nginx part. Then others could easier tell if a
“last”, “break” or “permanent” should be used in the rewrite conditions.

What web application is that what you use over there? I mean: What
software needs those rewrite rules? Is it something open that can be
downloaded from the web?

Btw, I’m running Nginx 0.7.64

Thanks.

An: [email protected]
Since I don’t know where you need those rewrites and what version of nginx
rewrite ^/articles/([^/.]+)/?$
rewrite ^/blogs/top/?$ /blogs.php?action=top_blogs? permanent;
rewrite ^/blogs/posts/([^/.]+)/category/([^/.]+)/?$
rewrite ^/blogs/posts/([^/.]+)/(\d+)/(\d+)/?$
permanent;
permanent;
/classifieds.php?scatUri=$3&page=$2&per_page=$1? permanent;
rewrite ^/photo/gallery_tag/([^/.]+)/?$ /browsePhoto.php?tag=$1?
permanent;
permanent;
/browseVideo.php?tag=$1&page=$3&per_page=$2? permanent;
rewrite ^/groups/all/?$ /grp.php permanent;

location /news/ {
rewrite ^/blogs/top_posts/?$ /blogs.php?action=top_posts?;
rewrite ^/blogs/posts/([^/.]+)/?$
rewrite ^/events/?$ /events.php?show_events=all&action=show?;
rewrite ^/events/part/([^/.]+)/?$
/classifieds.php?catUri=$3&page=$2&per_page=$1?;
rewrite ^/photo/gallery_top/?$ /browsePhoto.php?rate=top?;
}
rewrite ^/music/gallery/all/([^/.]+)/(\d+)/(\d+)/?$
rewrite ^/video/gallery_top/(\d+)/(\d+)/?$

}

RewriteCond %{REQUEST_FILENAME} -d
Or:
break;
Kind Regards,
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
[email protected]
nginx Info Page


Preisknaller: GMX DSL Flatrate für nur 16,99 Euro/mtl.!