I want rewrite
htttp://www.site.ru/company.html?name=bestcompany
to
htttp://www.site.ru/company/bestcompany.html
Please suggest where I was wrong. What I do:
RewriteRule ^company/([^/]*)\.html$ /company.html?name=$1 [L]
CMS modx, .htacces in root folder, full .htaccess code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.site\.ru [NC]
RewriteRule (.*) http://www.site.ru/$1 [R=301,L]
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
RewriteRule ^company/([^/]*)\.html$ /company?name=$1 [L]
Rearrange your rules like this: