RewriteEngine on

# disable directory browsing
Options All -Indexes

RewriteCond  %{REQUEST_FILENAME}  !(fckeditor)

RewriteRule ^(.+).html$ $1/?%{QUERY_STRING}

RewriteRule ^index/$ index.php

RewriteRule ^home/$ index.php

# RewriteRule ^registerOpenId/$ registerOpenId.php

# RewriteRule ^sitemap/$ siteMap.php

RewriteRule ^invitefriends/$ inviteFriends.php?&%{QUERY_STRING}

# RewriteRule ^email-forums/([^\/]+)/$ emailForums.php?tid=$1&%{QUERY_STRING}

RewriteRule ^email-answers/([^\/]+)/$ emailAnswers.php?title=$1&%{QUERY_STRING}

# RewriteRule ^email-debates/([^\/]+)/$ emailDebates.php?title=$1&%{QUERY_STRING}

RewriteRule ^staticpage/(.+)/$ staticPage.php?pg=$1&%{QUERY_STRING}

RewriteRule ^questions/$ questions.php

RewriteRule ^questions/dir/([^\/]+)/$ questions.php?cat=$1&%{QUERY_STRING}

RewriteRule ^questions/([^\/]+)/([^\/]+)/$ questions.php?view=$1&cid=$2&%{QUERY_STRING}

RewriteRule ^questions/([^\/]+)/$ questions.php?view=$1&%{QUERY_STRING}

RewriteRule ^answer/([^\/]+)/$ answer.php?title=$1&%{QUERY_STRING}

RewriteRule ^reply/answer/([^\/]+)/$ answer.php?title=$1&action=reply&%{QUERY_STRING}

RewriteRule ^edit/answer/([^\/]+)/$ answer.php?title=$1&action=edit&%{QUERY_STRING}

RewriteRule ^user/(.+)/$ myanswers.php?uid=$1&%{QUERY_STRING}

RewriteRule ^top/analysts/$ topAnalysts.php

RewriteRule ^popular-videos-audios/$ popularVideosAudios.php

RewriteRule ^subscribedtags/(.+)/$ mySubscribedTag.php?uid=$1&%{QUERY_STRING}

RewriteRule ^subscribedusers/(.+)/$ mySubscribedUser.php?uid=$1&%{QUERY_STRING}

# RewriteRule ^subscribedforums/(.+)/$ mySubscribedForum.php?uid=$1&%{QUERY_STRING}

RewriteRule ^categories/$ categories.php

RewriteRule ^userdetails/$ userDetails.php

RewriteRule ^widgetGenerator/$ widgetGenerate.php?block=show&%{QUERY_STRING}

#-------Members pages

RewriteRule ^my/settings/$ manageSettings.php

RewriteRule ^favoriteanswers/$ favoriteAnswers.php

RewriteRule ^videoupload/$ videoUpload.php

RewriteRule ^audioupload/$ audioUpload.php

RewriteRule ^externalvideoupload/$ externalVideoUpload.php

RewriteRule ^externalaudioupload/$ externalAudioUpload.php

#-------Mail---------

# RewriteRule ^mail/compose/$ mailCompose.php

# RewriteRule ^mail/([^\/]+)/$ mail.php?folder=$1&%{QUERY_STRING}

# RewriteRule ^readmail/([^\/]+)/$ mailRead.php?folder=$1&%{QUERY_STRING}

#-------welcome-----

# RewriteRule ^welcomeuser/$ welcome.php

#-------RSS Feeds-----

RewriteRule ^feed/(.+)/$ rss.php?act=$1

RewriteRule ^feed/$ rss.php

RewriteRule ^rssfeeds/$ rssFeeds.php

#-------Tag Cloud-----

RewriteRule ^tags/$ tags.php?%{QUERY_STRING}

#-------Embed Content----

RewriteRule ^embed/user/([^\/]+)/$ embedContent.php?embed=user&user=$1&%{QUERY_STRING}

RewriteRule ^embed/question/([^\/]+)/$ embedContent.php?embed=question&qid=$1&%{QUERY_STRING}

#------- importer------

RewriteRule ^common/classes/importer/index/$ common/classes/importer/index.php?frmname=form_contactus_show&fname=to_emails

#-------facebook-----------

RewriteRule ^facebook_auth/$ facebook_auth.php

RewriteRule ^welcomefacebookuser/$ facebookUser.php

RewriteRule ^addfacebookprofile/$ addFacebookProfile.php

#-------payment-----------

RewriteRule ^paymentupgrade/$ paymentUpgrade.php

RewriteRule ^paymentalertwindow/$ paymentAlertWindow.php

RewriteRule ^plandetails/$ planDetails.php

#------- ErrorDocument------

ErrorDocument 404 '<b>File Not Found</b>

RewriteCond   %{REQUEST_FILENAME}  !-f

RewriteRule ^([^\/]+)$ error.php

RewriteRule ^error/$ error.php

#-------Ning-----------
RewriteRule ^ninguser/$ ningUser.php