B
B
bilyaev822021-07-19 15:43:48
URL Handling
bilyaev82, 2021-07-19 15:43:48

Why is RewriteRule not working, CNC?

For several days now I can not solve the problem ... I'm completely exhausted. In general, there is a local site on openserver 5.2.2 (apache 2.4) at domains/myshop.local. It is created on the smarty engine. The www folder contains index.php and htaccess. There is such a link http://myshop.local/www/product/12 , which should be understood as ?controller=$1&id=$2 here is the htaccess code:
AddDefaultCharset utf-8
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine On
RewriteBase /

php_flag register_globals on

RewriteRule ^([az]+)/([az]+)/([0-9]+)/$ /?controller=$1&action=$2&id=$3&%{QUERY_STRING} [NS ,L]
RewriteRule ^([az]+)/([az]+)/$ /?controller=$1&action=$2&%{QUERY_STRING} [NS,L]
RewriteRule ^([az]+)/([0-9]+)/$ /?controller=$1&id=$2&%{QUERY_STRING} [NS,L]
RewriteRule ^(product)/([0-9]+ )/$ /?controller=$1&id=$2&%{QUERY_STRING} [NS,L]
RewriteRule ^([az]+)/$ /?controller=$1&%{QUERY_STRING} [NS,L]

RewriteCond $1 !^ (index\.php)
RewriteCond %{REQUEST_URI} !\.(css│js│jpg│gif)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php /$1 [L,QSA]

Accordingly, when following this link, it throws out an error 404. Moreover, when you write the link through the get parameter, and not the CNC - EVERYTHING WORKS. With regular seasons, I just didn’t dance with a tambourine). I can’t figure out how to solve this problem.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question