.htaccess issue in wordpress
-
09-07-2021 - |
Question
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>
Solution 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>
OTHER TIPS
Try this solution:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*[^/])$ $1/ [L,R=301]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow