RewriteEngine on

# disable directory browsing
Options All -Indexes

RewriteCond  %{REQUEST_FILENAME}  !(fckeditor)

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

RewriteRule ^loginopenid/$ loginOpenid.php

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

RewriteRule ^registerOpenId/$ registerOpenId.php

RewriteRule ^login-lightwindow/$ login_lightwindow.php?&%{QUERY_STRING}

RewriteRule ^register/$ signup.php?&%{QUERY_STRING}

RewriteRule ^activate/$ activateAccount.php?&%{QUERY_STRING}

RewriteRule ^activatemail/$ activateMailAccount.php?&%{QUERY_STRING}

RewriteRule ^changepassword/$ verifyMail.php?&%{QUERY_STRING}

RewriteRule ^contact/$ contactUs.php

RewriteRule ^support/$ contactUs.php

RewriteRule ^sitemap/$ siteMap.php

RewriteRule ^reportbugs/$ reportBugs.php

RewriteRule ^pointsdetails/$ pointsAndLevels.php

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

RewriteRule ^login/$ login.php

RewriteRule ^logout/$ logout.php

RewriteRule ^signup/$ signup.php

RewriteRule ^forgotpassword/$ forgotPassword.php

RewriteRule ^contactus/$ contactUs.php

RewriteRule ^verify/$ verifyMail.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

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

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

#------- Anova Urls ------

RewriteRule ^index/$ answers/index.php

RewriteRule ^home/$ answers/index.php

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

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

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

RewriteRule ^questions/$ answers/questions.php

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

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

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

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

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

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

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

RewriteRule ^top/analysts/$ answers/topAnalysts.php

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

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

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

RewriteRule ^categories/$ answers/categories.php

RewriteRule ^userdetails/$ answers/userDetails.php

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

RewriteRule ^my/settings/$ answers/manageSettings.php

RewriteRule ^favoriteanswers/$ answers/favoriteAnswers.php

RewriteRule ^videoupload/$ answers/videoUpload.php

RewriteRule ^audioupload/$ answers/audioUpload.php

RewriteRule ^externalvideoupload/$ answers/externalVideoUpload.php

RewriteRule ^externalaudioupload/$ answers/externalAudioUpload.php

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

RewriteRule ^feed/$ answers/rss.php

RewriteRule ^rssfeeds/$ answers/rssFeeds.php

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

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

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

RewriteRule ^facebook_auth/$ answers/facebook_auth.php

RewriteRule ^welcomefacebookuser/$ answers/facebookUser.php

RewriteRule ^addfacebookprofile/$ answers/addFacebookProfile.php

RewriteRule ^paymentupgrade/$ answers/paymentUpgrade.php

RewriteRule ^paymentalertwindow/$ answers/paymentAlertWindow.php

RewriteRule ^plandetails/$ answers/planDetails.php


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

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

RewriteCond   %{REQUEST_FILENAME}  !-f

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

RewriteRule ^error/$ error.php

RewriteRule ^ninglogin/$ ningLogin.php