i've been trying to convert this .htaccess for a week now
merlin corey
merlincorey at dc949.org
Wed Dec 30 00:28:09 MSK 2009
On Mon, Dec 28, 2009 at 6:24 PM, AMP Admin <admin at ampprod.com> 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.
>
> 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_page=$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]
>
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
More information about the nginx
mailing list