Editing: Refined the information based on the answers and doubts of the collaborators.
Internal urls in menus:
a href="/ courses / math /? slug = algebra-linear"> Math Algebra
a href="/ courses / science /? slug = molecular-structure"> Structural Sciences
a href="/ courses / english /? slug = basic-for-travel"> Basic English
I need the browser to appear:
site.com/cursos/matem/algebra-linear
site.com/cursos/ciencias/estrutura-molecular
site.com/sources/ingles/basico-para-travel
I used the Rewrite of Marcelo Rafael's edit 2 response (see below)
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(\.png)|(\.css)|(\.jpg)|(\.gif)|(\.mp4)$
RewriteCond %{REQUEST_URI} !(videos/)|(duv/)$
RewriteRule "^cursos\/(.+)\/(.+)" "http://site.com/cursos/$1/?slug=$2" [R]
Results:
a url: href="/ courses / math / algebra-linear" >
Browser appears
site.com/courses/matem/?slug=algebra-linear
Is not there a reversal in Rewrite?
In both cases the linked pages open normally. And other site directories are OK.
Estrutura do site:
.htacess
index.php
css/
js/
funções/
forum/
duvidas/
exames/
cursos/
matem/index.php (os subdiretorios são os tipos de cursos)
/imgs/
/duv/
/videos/
pag1 <= slug
pag2 <= slug
ciencias/index.php
/imgs/
/duv/
/videos/
pag1 <= slug
pag2 <= slug
(são dezenas de cursos)
I apologize if I did not use the correct technical terms and appreciate all help and suggestions
my complete htaccess
##### LOCAWEB - NAO REMOVER #####
AddHandler php71-script .php
suPHP_ConfigPath /home/site/
##### LOCAWEB - NAO REMOVER #####
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(\.png)|(\.css)|(\.jpg)|(\.gif)|(\.mp4)$
RewriteCond %{REQUEST_URI} !(videos/)|(duv/)$
RewriteRule "^cursos\/(.+)\/(.+)" "http://site.com/cursos/$1/?slug=$2" [R]
RewriteEngine On
ErrorDocument 404 /erros-4xx.php
ErrorDocument 500 /erros-4xx.php
ErrorDocument 403 /erros-4xx.php
ErrorDocument 400 /erros-4xx.php
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE application/x-httpd-eruby
AddOutputFilterByType DEFLATE text/html
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch ^HMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
</IfModule>
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/cache-manifest "access plus 0 seconds"
ExpiresByType text/html "access plus 1 hour"
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
</IfModule>
<IfModule mod_headers.c>
Header set X-UA-Compatible "IE=Edge"
<FilesMatch "\.(js|css|gif|png|jpeg|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" >
Header unset X-UA-Compatible
</FilesMatch>
</IfModule>
I've deleted everything and just left Rewrite, but it's still the same. Where is it wrong? It's a challenge for everyone.