Answer the question
In order to leave comments, you need to log in
Redirect from www + CNC?
There is a site with a customized CNC. When added to the url www, the CNC flies rainbow. That is: site.ru/article/statia-o-putine
→ www.site.ru/article.php?slug=statia-o-putine
.htaccess
RewriteEngine On
RewriteBase /
# ЧПУ
RewriteRule ^article/([^/]*)$ /article.php?id=$1 [L]
RewriteRule ^category/([^/]*)$ /articles.php?genre=$1 [L]
RewriteRule ^search/([^/]*)$ /search.php?q=$1 [L]
# Без слеша в конце
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
site.ru/article/statia-o-putine
→site.ru/article.php?slug=statia-o-putine
Answer the question
In order to leave comments, you need to log in
Hello.
It seems that the CNC crashes, because your checks for articles, category, search are higher, and when the replacement for them is triggered, then further checking and processing is cut off due to [L].
Try checking for www to put above the state of emergency and remove the parameter L
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question