.htaccess issue in wordpress
-
09-07-2021 - |
Domanda
In my site the URL
1) http://www.example.com/pt-br/perguntas-frequentes/ - shows error
2) http://www.example.com/pt-br/perguntas-frequentes - working fine.
I am using WPML plugin Code as follows
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Soluzione 2
I fixed the issue by using the following code
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php/ [L]
</IfModule>
Altri suggerimenti
Try this solution:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*[^/])$ $1/ [L,R=301]
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow