0
Edition: I refined the information based on the answers and questions of the employees.
internal urls in menus:
a href="/cursos/matem/? Slug=Algebra-linear">Mathematics Algebra
a href="/cursos/ciencias/? Slug=structure-molecular">Sciences Structures
a href="/courses/ingles/? Slug=basico-para-viagens">Ingles Básico
I need it to appear in the browser:
site.com/cursos/matem/Algebra-linear
site.com/courses/science/molecular structure
site.com/courses/English/basic-for-travel
I used the Rewrite of Marcelo Rafael’s Reply Issue 2 (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:
the url: href="/courses/matem/Algebra-linear">
In the browser appears
site.com/cursos/matem/? Slug=Algebra-linear
There is no inversion in Rewrite?
In both cases the linked pages open normally. And other directories of the site 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 I appreciate all help and suggestion
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 already erased everything and only left Rewrite, but it’s still the same.
Where is it wrong? It’s a challenge for everyone.
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero
@Maniero why ?
– Alex
Because here it is not a forum, the comments are not for discussions, for problem solving interactively. Whenever it gets long is because there is something wrong (question or answer are bad and is not helping) and the system signals.
– Maniero
@Maniero roger con, vlw
– Alex