RewriteEngine On
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]


#SITEMA DE LINKS DINAMICOS

RewriteRule  ^login 				auth-login.php		 	     [NC,L]
RewriteRule  ^sair 					sair.php		 		 [NC,L]
RewriteRule  ^administradores		administradores.php	 		 [NC,L]
RewriteRule  ^usuarios		usuarios.php	 		 [NC,L]
RewriteRule  ^afiliados		afiliados.php	 		 [NC,L]

RewriteRule  ^configuracoes		configuracoes.php	 		 [NC,L]
RewriteRule  ^gerenciamento-nomes		ge-nomes.php	 		 [NC,L]
RewriteRule  ^gerenciar-tarefas		ge-tarefas.php	 		 [NC,L]
RewriteRule  ^pixel		pixeis.php	 		 [NC,L]
RewriteRule  ^identidade-visual		imagens-plataforma.php		 [NC,L]
RewriteRule  ^banners		editar-banners.php	 		 [NC,L]
RewriteRule  ^gerenciar-modal		editar-modals.php	 		 [NC,L]
RewriteRule  ^mensagens		editar-mensagens.php	 	[NC,L]
RewriteRule  ^popups		editar-popups.php	 		 [NC,L]
RewriteRule  ^baixarpop		popup-baixar.php	 		 [NC,L]
RewriteRule  ^numeros-jackpot		numeros-jackpot.php	 		 [NC,L]
RewriteRule  ^iconesfloat		editar-floats.php	 		 [NC,L]
RewriteRule  ^suitpay		suitpay.php	 		 [NC,L]
RewriteRule  ^digitopay		digitopay.php	 		 [NC,L]
RewriteRule  ^royalbenk		royalbenk.php	 		 [NC,L]
RewriteRule  ^pixup		pixup.php	 		 [NC,L]
RewriteRule  ^temas		temas.php	 		 [NC,L]
RewriteRule  ^jackpot		jackpot.php	 		 [NC,L]
RewriteRule  ^jogos		jogos.php	 		 [NC,L]
RewriteRule  ^provedores		provedores.php	 		 [NC,L]
RewriteRule  ^baus		baus.php	 		 [NC,L]
RewriteRule  ^api-fiverscan		api-fiverscan.php	 		 [NC,L]
RewriteRule  ^api-pg12		api-12.php	 		 [NC,L]
RewriteRule  ^api-pg16		api-16.php	 		 [NC,L]
RewriteRule  ^api-pp38		api-38.php	 		 [NC,L]
RewriteRule  ^api-playfiver		api-playfiver.php	 		 [NC,L]

# ---- Super Admin Panel upgrade (new pages) ----
RewriteRule  ^bets			bets.php	 		 [NC,L]
RewriteRule  ^reports			reports.php	 		 [NC,L]
RewriteRule  ^export-report		export_report.php	 	 [NC,L]
RewriteRule  ^relatorio-afiliados	relatorio-afiliados.php		 [NC,L]
RewriteRule  ^activity-logs		activity_logs.php		 [NC,L]
RewriteRule  ^payment-methods		payment_methods.php		 [NC,L]
RewriteRule  ^gateway-numbers		gateway_numbers.php		 [NC,L]
RewriteRule  ^topup-manual		topup_manual.php		 [NC,L]
RewriteRule  ^chat-settings		chat_settings.php		 [NC,L]
RewriteRule  ^cupons			cupons.php	 		 [NC,L]
RewriteRule  ^bonus-assign		bonus_assign.php	 [NC,L]
RewriteRule  ^bonus-campaigns	bonus_campaigns.php	 [NC,L]
RewriteRule  ^usuarios-ativos		usuarios-ativos.php		 [NC,L]
RewriteRule  ^usuarios-banidos		usuarios-banidos.php		 [NC,L]
RewriteRule  ^depositos-historico	depositos-historico.php		 [NC,L]
RewriteRule  ^saques-historico		saques-historico.php		 [NC,L]

# ---- Agent system ----
RewriteRule  ^agentes			agentes.php	 		 [NC,L]
RewriteRule  ^detalhes_agente		detalhes_agente.php		 [NC,L]

RewriteRule  ^depositos_pagos 		depositos_pagos.php		 		 [NC,L]
RewriteRule  ^depositos_pendentes		depositos_pendentes.php		 		 [NC,L]
RewriteRule  ^depositos_expirados		depositos_expirados.php		 		 [NC,L]

RewriteRule  ^saques_pendentes		saques_pendentes.php	 		 [NC,L]
RewriteRule  ^saques_recusados		saques_recusados.php	 		 [NC,L]
RewriteRule  ^saques_aprovados		saques_aprovados.php	 		 [NC,L]

RewriteRule  ^saques_afiliados_pendentes		saques_afiliados_pendentes.php	 		 [NC,L]
RewriteRule  ^saques_afiliados_recusados		saques_afiliados_recusados.php	 		 [NC,L]
RewriteRule  ^saques_afiliados_aprovados		saques_afiliados_aprovados.php	 		 [NC,L]


RewriteRule  ^detalhes_usuario?=(.*)$ detalhes_usuario.php?slug=$1 [NC,L]
RewriteRule  ^edit_banner?=(.*)$    edit_banner.php?slug=$1 	         [NC,L]
RewriteRule  ^edit_popups?=(.*)$    edit_popups.php?slug=$1 	         [NC,L]
RewriteRule  ^games?=(.*)$    games.php?slug=$1 	         [NC,L]













#RewriteRule  ^editar-produto/(.*)$/?$    editar-produto.php?slug=$1 	     [NC,L]





RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_rewrite.c>
	<IfModule mod_negotiation.c>
		Options -MultiViews
	</IfModule>
</IfModule>
# ----------------------------------------------------------------------
# | Anti- Clickjacking                                                       |
# ----------------------------------------------------------------------
 <IfModule mod_headers.c>
 Header set X-Frame-Options "DENY"
 # `mod_headers` cannot match based on the content-type, however,
 # the `X-Frame-Options` response header should be send only for
 # HTML documents and not for the other resources.
 <FilesMatch "\.(appcache|ttf|ttc|otf|eot|woff|font.css|css|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
    # Header unset X-Frame-Options
 </FilesMatch>
</IfModule>

# ----------------------------------------------------------------------
# | Negando acesso aos diretórios                                                      |
# ---------------------------------------------------------------------
	<IfModule mod_autoindex.c>
		Options -Indexes
	</IfModule>
	
# ----------------------------------------------------------------------
# | Bloqueando arquivos sensiveis                                                  |
# ----------------------------------------------------------------------	
	<FilesMatch "(^#.*#|\.(bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$">

		# Apache < 2.3
		<IfModule !mod_authz_core.c>
			Order allow,deny
			Deny from all
			Satisfy All
		</IfModule>

		# Apache ≥ 2.3
		<IfModule mod_authz_core.c>
			Require all denied
		</IfModule>

	</FilesMatch>
	
	# ----------------------------------------------------------------------
	# | Cross-Site Scripting (XSS) Ataque                                  |
	# ----------------------------------------------------------------------
		<IfModule mod_headers.c>
		 #                           (1)    (2)
		 Header set X-XSS-Protection "1; mode=block"
		 # `mod_headers` cannot match based on the content-type, however,
		 # the `X-XSS-Protection` response header should be send only for
		 # HTML documents and not for the other resources.
		 <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
			 Header unset X-XSS-Protection
		 </FilesMatch>
	 </IfModule>
	 
	 <IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/opentype
# For Older Browsers Which Can't Handle Compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>