Skip to content

Instantly share code, notes, and snippets.

@isaumya
Created October 25, 2017 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaumya/26849a393509d896d927b6241c2d9f5b to your computer and use it in GitHub Desktop.
Save isaumya/26849a393509d896d927b6241c2d9f5b to your computer and use it in GitHub Desktop.
Dynamic Level Website htaccess code that needs to be converted to the respective nginx varient in the nginx config file in the new LEMP based server
#----Rewrite Rule for New Version-------------
RewriteRule ^chart/charts-technicals-large/(.+)$ wp-charts_technicals_large_report.php?f=charts-technicals&r=$1 [NC,L]
RewriteRule ^crossweb/(.+)$ https://www.dynamiclevels.com/ [NC,L]
RewriteRule ^crossnet/(.+)$ https://www.dynamiclevels.com/ [NC,L]
#------------------RSS Feed URL---------------
RewriteRule ^rss/daily-market-update.rss wp-rss.php?f=1 [NC,L]
RewriteRule ^rss/nifty-50.rss wp-rss.php?f=2 [NC,L]
RewriteRule ^rss/nse-stocks.rss wp-rss.php?f=3 [NC,L]
RewriteRule ^rss/nse-sectoral-stocks.rss wp-rss.php?f=4 [NC,L]
RewriteRule ^rss/top-500-stocks.rss wp-rss.php?f=5 [NC,L]
RewriteRule ^rss/multibagger-stocks.rss wp-rss.php?f=6 [NC,L]
RewriteRule ^rss/bank-nifty.rss wp-rss.php?f=7 [NC,L]
RewriteRule ^rss/nifty-it.rss wp-rss.php?f=8 [NC,L]
RewriteRule ^rss/nifty-pharma.rss wp-rss.php?f=9 [NC,L]
RewriteRule ^rss/nifty-fmcg.rss wp-rss.php?f=10 [NC,L]
RewriteRule ^rss/nifty-auto.rss wp-rss.php?f=11 [NC,L]
RewriteRule ^rss/nifty-realty.rss wp-rss.php?f=12 [NC,L]
RewriteRule ^rss/nifty-media.rss wp-rss.php?f=13 [NC,L]
RewriteRule ^rss/nifty-finance.rss wp-rss.php?f=14 [NC,L]
RewriteRule ^rss/nifty-energy.rss wp-rss.php?f=15 [NC,L]
RewriteRule ^rss/nifty-metal.rss wp-rss.php?f=16 [NC,L]
RewriteRule ^rss/price-history-nse-stocks.rss wp-rss.php?f=17 [NC,L]
RewriteRule ^rss/research-reports.rss wp-rss.php?f=18 [NC,L]
RewriteRule ^rss/news.rss wp-news-rss.php [NC,L]
RewriteRule ^rss/news-index.rss wp-news-index-rss.php [NC,L]
RewriteRule ^rss/news-(.+).rss wp-news-date-rss.php?d=$1 [NC,L]
RewriteRule ^rss/blog.rss wp-blog-rss.php [NC,L]
#------------------RSS Feed URL END-----------
RewriteRule ^invest-with-us$ https://www.dynamiclevels.com/en/invest-with-us/nifty-options [NC,L]
RewriteRule ^en/invest-with-us$ https://www.dynamiclevels.com/en/invest-with-us/nifty-options [NC,L]
RewriteRule ^invest-with-us/nifty-options https://www.dynamiclevels.com/en/invest-with-us/nifty-options [NC,L]
RewriteRule ^invest-with-us/equity https://www.dynamiclevels.com/en/invest-with-us/equity [NC,L]
RewriteRule ^invest-with-us/pms https://www.dynamiclevels.com/en/invest-with-us/pms [NC,L]
RewriteRule ^free-share-market-training https://www.dynamiclevels.com/en/free-share-market-training [NC,L]
RewriteRule ^free-trading-tips/nifty-options https://www.dynamiclevels.com/en/free-trading-tips/nifty-options [NC,L]
RewriteRule ^free-trading-tips/equity https://www.dynamiclevels.com/en/free-trading-tips/equity [NC,L]
RewriteRule ^free-trading-tips$ https://www.dynamiclevels.com/en/free-trading-tips/nifty-options [NC,L]
RewriteRule ^en/free-trading-tips$ https://www.dynamiclevels.com/en/free-trading-tips/nifty-options [NC,L]
RewriteRule ^en/$ https://www.dynamiclevels.com [R=301,L]
RewriteRule ^blog/(.+) https://www.dynamiclevels.com/en/blog/$1 [R=301,L]
RewriteRule ^login https://www.dynamiclevels.com/en/login [R=301,L]
RewriteRule ^register https://www.dynamiclevels.com/en/register [R=301,L]
#redirect 404 /robots.txt
RewriteRule ^fundamental/(.+)/fundamental-reports-download$ wp-report-download.php?ins=$1 [NC,L]
#----Rewrite Rule for New Version END-------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Exception on server status (Percona)
RewriteRule ^(server-info|server-status) - [L]
RewriteRule ^admin$ wp-login.php [NC,L]
RewriteRule ^logout$ wp-logout.php [NC,L]
#RewriteRule ^en/account-portfolio/$ wp-portfolio.php/ [NC,L]
#RewriteRule ^en/account-portfolio/(.+)$ wp-portfolio.php?f=$1 [NC,L]
RewriteRule ^en/portfolio/(.+)$ wp-portfolio.php?f=$1 [NC,L]
## To Convert All non-www traffic to www ##
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
## To Convert All HTTP Traffic to HTTPS ##
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.dynamiclevels.com%{REQUEST_URI} [R=301,L]
#RewriteCond %{REQUEST_URI} !^\/railway_budget_2015.php
RewriteCond %{REQUEST_URI} !^\/union_budget_2015.php
#RewriteCond %{REQUEST_URI} !^\/cash-equity-7Ps-trading-signup
RewriteCond %{REQUEST_URI} !^\/tsadmin
#RewriteCond %{REQUEST_URI} !\/news\/ [NC]
#RewriteCond %{REQUEST_URI} !\/news\/details\/ [NC]
#RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#RewriteCond %{HTTP_HOST} ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
#RewriteRule ^(.*)$ https://www.dynamiclevels.com$1 [R=301,L]
RewriteCond %{HTTP_REFERER} reddit\.com [NC,OR]
RewriteCond %{HTTP_REFERER} lifehacker\.com [NC,OR]
RewriteCond %{HTTP_REFERER} xn--lifehacer-1rb\.com
RewriteRule .* - [F]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment