##
# @package		Joomla
# @copyright	Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.
# @license		GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
##

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

## Mod_rewrite in use.

RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
# Block out any script that includes a <script> tag in URL.
# Block out any script trying to set a PHP GLOBALS variable via URL.
# Block out any script trying to modify a _REQUEST variable via URL.
# Return 403 Forbidden header and show the content of the root homepage
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.

# 301 --- http://www.psz.pt/index.php/pt/a-psz => http://www.psz.pt/index.php/a-psz-consulting/sobre-a-psz
RewriteRule ^index\.php/pt/a-psz$ /index.php/a-psz-consulting/sobre-a-psz? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/a-psz/porque-trabalhar-com-a-psz => http://www.psz.pt/index.php/a-psz-consulting/estatisticas
RewriteRule ^index\.php/pt/a-psz/porque-trabalhar-com-a-psz$ /index.php/a-psz-consulting/estatisticas? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/a-psz/a-equipa-psz => http://www.psz.pt/index.php/a-psz-consulting/a-equipa-psz
RewriteRule ^index\.php/pt/a-psz/a-equipa-psz$ /index.php/a-psz-consulting/a-equipa-psz? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/a-psz/parceiros => http://www.psz.pt/index.php/a-psz-consulting/parceiros
RewriteRule ^index\.php/pt/a-psz/parceiros$ /index.php/a-psz-consulting/parceiros? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/contabilidade-e-gestao => http://www.psz.pt/index.php/servicos/consultoria-avancada-de-gestao/contabilidade-de-gestao
RewriteRule ^index\.php/pt/contabilidade-e-gestao$ /index.php/servicos/consultoria-avancada-de-gestao/contabilidade-de-gestao? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/contabilidade-e-gestao/contabilidade-e-fiscalidade => http://www.psz.pt/index.php/servicos/consultoria-avancada-de-gestao/contabilidade-de-gestao
RewriteRule ^index\.php/pt/contabilidade-e-gestao/contabilidade-e-fiscalidade$ /index.php/servicos/consultoria-avancada-de-gestao/contabilidade-de-gestao? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/contabilidade-e-gestao/controlo-de-gestao => http://www.psz.pt/index.php/servicos/consultoria-avancada-de-gestao/contabilidade-de-gestao
RewriteRule ^index\.php/pt/contabilidade-e-gestao/controlo-de-gestao$ /index.php/servicos/consultoria-avancada-de-gestao/contabilidade-de-gestao? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/contabilidade-e-gestao/apoio-administrativo => http://www.psz.pt/index.php/servicos/consultoria-avancada-de-gestao/contabilidade-de-gestao
RewriteRule ^index\.php/pt/contabilidade-e-gestao/apoio-administrativo$ /index.php/servicos/consultoria-avancada-de-gestao/contabilidade-de-gestao? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/contabilidade-e-gestao/criacao-de-empresas => http://www.psz.pt/index.php/servicos/consultoria-avancada-de-gestao/contabilidade-de-gestao
RewriteRule ^index\.php/pt/contabilidade-e-gestao/criacao-de-empresas$ /index.php/servicos/consultoria-avancada-de-gestao/contabilidade-de-gestao? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos
RewriteRule ^index\.php/pt/incentivos$ /index.php/servicos/crescimento-e-expansao/incentivos? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/candidaturas-qren => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/candidaturas-qren$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/candidaturas-qren/investigacao-e-desenvolvimento => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/candidaturas-qren/investigacao-e-desenvolvimento$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/candidaturas-qren/internacionalizacao => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/candidaturas-qren/internacionalizacao$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/candidaturas-qren/inovacao => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/candidaturas-qren/inovacao$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/candidaturas-qren/poph => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/candidaturas-qren/poph$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/candidaturas-qren/vale-empreendedorismo-e => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/candidaturas-qren/vale-empreendedorismo-e$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/qec-quadro-estrategico-comum => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/qec-quadro-estrategico-comum$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/proder => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/proder$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/sifide => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/sifide$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/finicia => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/finicia$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/comercio-investe => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios
RewriteRule ^index\.php/pt/incentivos/comercio-investe$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-comunitarios? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/iefp => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/incentivos/incentivos-contratacao
RewriteRule ^index\.php/pt/incentivos/iefp$ /index.php/servicos/crescimento-e-expansao/incentivos/incentivos-contratacao? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/planos-de-negocio => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/planos-de-negocio
RewriteRule ^index\.php/pt/incentivos/planos-de-negocio$ /index.php/servicos/crescimento-e-expansao/planos-de-negocio? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/incentivos/estudos-de-viabilidade => http://www.psz.pt/index.php/servicos/crescimento-e-expansao/analise-economico-financeira
RewriteRule ^index\.php/pt/incentivos/estudos-de-viabilidade$ /index.php/servicos/crescimento-e-expansao/analise-economico-financeira? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/empreendedorismo => http://www.psz.pt/index.php/empreendedorismo
RewriteRule ^index\.php/pt/empreendedorismo$ /index.php/empreendedorismo? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/empreendedorismo/balcao-do-empreendedor => http://www.psz.pt/index.php/empreendedorismo/balcao-do-empreendedor
RewriteRule ^index\.php/pt/empreendedorismo/balcao-do-empreendedor$ /index.php/empreendedorismo/balcao-do-empreendedor? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/empreendedorismo/gae-feup => http://www.psz.pt/index.php/empreendedorismo/gabinete-de-apoio-ao-empreendedorismo
RewriteRule ^index\.php/pt/empreendedorismo/gae-feup$ /index.php/empreendedorismo/gabinete-de-apoio-ao-empreendedorismo? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/empreendedorismo/consultorio-empreendedor-inovagaia => http://www.psz.pt/index.php/empreendedorismo/iniciativas
RewriteRule ^index\.php/pt/empreendedorismo/consultorio-empreendedor-inovagaia$ /index.php/empreendedorismo/iniciativas? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/empreendedorismo/open-mind-network => http://www.psz.pt/index.php/empreendedorismo/iniciativas
RewriteRule ^index\.php/pt/empreendedorismo/open-mind-network$ /index.php/empreendedorismo/iniciativas? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/empreendedorismo/pszbreakfast => http://www.psz.pt/index.php/empreendedorismo/psz-breakfast
RewriteRule ^index\.php/pt/empreendedorismo/pszbreakfast$ /index.php/empreendedorismo/psz-breakfast? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/outros-servicos => http://www.psz.pt/index.php/servicos
RewriteRule ^index\.php/pt/outros-servicos$ /index.php/servicos? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/outros-servicos/formacao => http://www.psz.pt/index.php/servicos
RewriteRule ^index\.php/pt/outros-servicos/formacao$ /index.php/servicos? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/outros-servicos/certificacao-dgert => http://www.psz.pt/index.php/servicos/certificacao-dgert
RewriteRule ^index\.php/pt/outros-servicos/certificacao-dgert$ /index.php/servicos/certificacao-dgert? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/outros-servicos/loja-online => http://www.psz.pt/index.php/servicos
RewriteRule ^index\.php/pt/outros-servicos/loja-online$ /index.php/servicos? [L,R=301]

# 301 --- http://www.psz.pt/index.php/pt/contactos => http://www.psz.pt/index.php/contactos
RewriteRule ^index\.php/pt/contactos$ /index.php/contactos? [L,R=301]

#
## End - Custom redirects

##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
# and the requested path and file doesn't directly match a physical file
# and the requested path and file doesn't directly match a physical folder
# internally rewrite the request to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L] 
#
## End - Joomla! core SEF Section.

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php56___lsphp .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
