RewriteRule ^order/([^/]*)(/?)+$ index.php?do=order&name=$1 [L]
Everything works as it should for me, only site.ru/order (without a slash at the end) returns error 404. How can I fix it?
RewriteRule ^order/([^/]*)(/?)+$ index.php?do=order&name=$1 [L]
Everything works as it should for me, only site.ru/order (without a slash at the end) returns error 404. How can I fix it?
For CEO it is better that each content acc. just one url. We will consider the "correct" URL with a slash at the end. Instead of site.ru
enter your website address.
# Вар. 1 - должно начинаться с order и заканчиваться слешем RewriteCond %{REQUEST_URI} ^order/(.+)/$ RewriteRule ^order/(.+)/$ index.php?do=order&name=$1 [L] # Вар. 2 - пришли без слеша в конце - редиректить на "правильный" RewriteCond %{REQUEST_URI} ^order RewriteCond %{REQUEST_URI} !/$ RewriteRule ^(.*)$ http://site.ru/$1/ [L,R=301]
Source: https://ru.stackoverflow.com/questions/140177/
All Articles